haji

haji

  • NA
  • 7
  • 17.8k

SQL query to get date whatever the format it is inserted in database?

Sep 10 2012 7:16 AM

Hii,,

I am using custom format to store the date in the database .It should be stored in this form MM/dd/yyyy. I have to retrieve the results based on the date.My table looks like this:

Id                      Name                      Date 

1                       Diya                         09/10/2012

2                       Naitik                       09/10/2012

Now to retrieve this data if I write a query to select the records on 9/10/2012 then it is showing null results ..What I want is whatever the date format I give(9/10/2012 or 09/10/2012) I should be able to retrieve the results .How can I write the SQL query for this?

Thanks,,,


Answers (2)