Jump to content
  • Advertisement
Sign in to follow this  
md_lasalle

Date Format in SQL Query

This topic is 4971 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, i have a 'lil problem, when i began my app, i decided to put every Date Field as a Text field in the Access Database. But now my app is given me a hard time when i wanna test if something is between date1 and date2 or just to order by date! i've searched a lot and didnt find an example of what im trying to do. all my date are saved in this format : dd-mm-yy Is there a way I could do something Like "Select * From Table Order By SomeFunctionThatConvertsToDate([myDate]);" ?? thanks

Share this post


Link to post
Share on other sites
Advertisement
I don't know how to do it in Access (maybe CDate() ?), but in T-SQL (SQL Server), you could do:
SELECT * FROM Table ORDER BY CAST(datCol as datetime)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!