Where DAY(errorDate) = 20 AND MONTH(errorDate) = 12 AND YEAR(errorDate) = 2008 You can either use any of the recommend range queries mentioned, or in SQL Server 2008, you could use the DATE only date time - or you could do a check something like: select * from tblErrorLog If you check for exact match with just the date part, you'll get only rows that match with a time of 0:00:00 - nothing else. Second of all, you need to be aware that SQL Server 2005 DATETIME always includes a time. ISO-8601 is the YYYYMMDD format - no spaces, no dashes - just the data: select * from tblErrorLog First of all, I'd recommend using the ISO-8601 standard format for date/time - it works regardless of the language and regional settings on your SQL Server.
0 Comments
Leave a Reply. |