Dates searching

Results 1 to 2 of 2

Thread: Dates searching

  1. #1
    Join Date
    Dec 1969

    Default Dates searching

    How can I make SQL select statement that read Dates mm/dd/yyyy from SQL-Server DB and display it as dd/mm/yyyy. <BR>Next I want to make search in these dates, for example if I search for 2/2002 it should retrieve me all dates in month February of 2002. I used <BR>Select * from Date_Table where myDate like ‘%2/2002%’ <BR>But it doesn’t work !!<BR>Thank u all<BR>

  2. #2
    Join Date
    Dec 1969

    Default Partially crossposted...

    ...see answers in ASP Q&A forum.<BR><BR>As for the month/year check:<BR><BR>SELECT * ... WHERE Month(myDate) = 2 AND Year(myDate) = 2002<BR><BR>You can&#039;t use wild cards with dates. (And even if you could, the code you showed would find 1/12/2002 -- a date in December!)<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts