I have a column of type datetime
with values like 2009-10-20 10:00:00
I want to extract the date from datetime
and write a query like:
SELECT * FROM
data
WHERE datetime = '2009-10-20'
ORDER BY datetime DESC
Is the following the best way to do it?
SELECT * FROM
data
WHERE datetime BETWEEN('2009-10-20 00:00:00' AND '2009-10-20 23:59:59')
ORDER BY datetime DESC
This, however, returns an empty resultset. Any suggestions?
add comment
0 Answer
Your Answer
asked | |
viewed | 14 |
Related
- 1how to write a function to get the current date?
- 1Reset the display of the placeholder inside a select
- 1select statman sql server.
- 1how to write a function to test whether a date is a weekend.
- 0MySQL select records created before a certain time ago
- 1How to select an element with many classes with jQuery?
- 2Get String in YYYYMMDD format from JS date object?
- 1How can I convert time and date with zero prefix by javascript ?
- 0How to detect your website visitor's date and time on the server side
- 0How to select background color of menu item
- 0How to select background color of menu item