Comparing Date Values in SQL Server
Written by Eric Smith, Northstar Computer Systems LLC
If you are comparing dates within SQL Server, you may get some unexpected results if you don't remember that every date value and both date and time components in it. For instance, '6-19-2000' is not the same as '6-19-2000 7:00 PM', because any date without a time is given a time of 00:00:00. If you do need to compare the dates, you can use any number of functions to compare month, day, and year. You can also convert both dates to text using the CONVERT function and then compare just the date portion.
Keywords: [
Uncategorized ASP Tips
]
Publication Date: 7/1/2000
|