benvegiard
Programmer
Hi,
I'd like to delete all records from a table that have today's date. In the table, the time is also stored, so
WHERE StatDate = GetDate() or
WHERE StatDate = '2003-07-23'
matches 0 records since it compares to both date AND time. I can use CONVERT with a style to strip out the time portion, but it's messy and difficult to remember the technique.
What is the easiest way to compare only on the date portion of a DateTime?
Thanks,
Ben
I'd like to delete all records from a table that have today's date. In the table, the time is also stored, so
WHERE StatDate = GetDate() or
WHERE StatDate = '2003-07-23'
matches 0 records since it compares to both date AND time. I can use CONVERT with a style to strip out the time portion, but it's messy and difficult to remember the technique.
What is the easiest way to compare only on the date portion of a DateTime?
Thanks,
Ben