Hello all,
I have a SQL database and am writing a query to return records based on a date. This is desired to be automated, so each time it runs, it looks at past date date.
Problem is the SQL data is stored without the time portion. So it's '2008-05-19 00:00:00.000'. Or course, getdate() returns the current time as well. That makes a problem, given the 24 hour clock.
If there was a way to say RequiredDate = getdate()without getdate including the time.
I have tried looking at the FAQ and searching, but cannot seem to find this one, which I am sure is pretty simple. I just seem to be working around it without getting any closer. Any help will be appreciated.
I have a SQL database and am writing a query to return records based on a date. This is desired to be automated, so each time it runs, it looks at past date date.
Problem is the SQL data is stored without the time portion. So it's '2008-05-19 00:00:00.000'. Or course, getdate() returns the current time as well. That makes a problem, given the 24 hour clock.
If there was a way to say RequiredDate = getdate()without getdate including the time.
I have tried looking at the FAQ and searching, but cannot seem to find this one, which I am sure is pretty simple. I just seem to be working around it without getting any closer. Any help will be appreciated.