General information
Title:
How to use only date portion to compare SQL datetime value
Environment versions
Network:
Windows 2003 Server
Hello
A datetime field in SQL may be 'Oct 1,2005 04:00PM'
But when selecting records for a range of dates from 'Oct 1,2005' to 'Oct 1,2005' , SQL Server assumes a default time of '12:00AM' so the transaction is not selected.
A solution is to set the final search date to 'Oct 1,2005 11:59PM' but my question is : Is it possible to compare only the date portion and ignore the time portion ?
Thanks
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only