I have a table that that has a datetime column and I want to select all records that are of a specific date regardless of the time.
When I try this code in query analyzer I get no records returned:
SELECT *
FROM TCData
WHERE TCData.dClockTime = '06/16/2006'
I suspect it is because without the time part it is not equal to anything. However, using this where clause returns nothing as well and I know there is 1 record with this datetime.
WHERE TCData.dClockTime = '06/16/2006 9:00:10 AM'
I'm guessing I need to Convert/Cast but am not sure how to do this just to get the date from a datetime. This has to be something pretty easy. Any help would be appreciated.
Ed
When I try this code in query analyzer I get no records returned:
SELECT *
FROM TCData
WHERE TCData.dClockTime = '06/16/2006'
I suspect it is because without the time part it is not equal to anything. However, using this where clause returns nothing as well and I know there is 1 record with this datetime.
WHERE TCData.dClockTime = '06/16/2006 9:00:10 AM'
I'm guessing I need to Convert/Cast but am not sure how to do this just to get the date from a datetime. This has to be something pretty easy. Any help would be appreciated.
Ed