in

System.Data.SQLite

An open-source, enhanced version of the SQLite database engine for Windows

Best method for DateTime

Last post 09-13-2007 7:34 AM by Robert Simpson. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-10-2007 11:43 PM

    Best method for DateTime

    Hi,

     In my application, I use a lot of DateTime field. I have a lot of query which use a dateTime field. For example:

    - Select all data for a selected week

    - Select all data for a selected month, or year

    So, what is the best method to handle these query :

    -> Use a DateTime field, but with SQLite, function Year(), Month(), does not exist. So a lot of supplementary tasks should be done for getting the year and the month information from the DateTime field.

    -> Split the DateTime information into 3 fields : year, month, day. So it's easy to make the previous query with these information.

    What is your opinion ?  


     

    Filed under:
  • 09-13-2007 7:34 AM In reply to

    Re: Best method for DateTime

    Read up on the datetime functions available in the SQLite engine core at:

    http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems