Jump to content

Query With Datetime Stamp


gala

Recommended Posts

our database stores the time in datetime format (YYYY-MM-DD HH:MM:SS). Assuming it stores it in "date" column. I need to select entries only between certain days. I am using this query:select * from table_name where date between '2009-04-01 00:00:00' and '2009-04-05 24:59:59'this return Empty set, but I know for sure that data is there. Would you, please, correct my query. thank you

Link to comment
Share on other sites

Different databases use different date formats for their queries. Look up the manual for the database you're using to find out which format to use for the field type you're using. Don't assume it's a "date" column. Look it up.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...