I am storing datetime to database as a standard datetime like 2011-10-19 17:18:44.083. I need to select all the rows if the datetime field is equals to 5 days after today. But I dont want this comparison also in time just the day is enough.
SELECT * FROM dbo.TestBox
where TargetDate = dateadd(day,5, getdate())
This is not working, I dont know exactly why but probably its looking at time.
Thanks in advance,
If you’re using 2008+, you can cast both as a Date:
If you’re using 2005 or prior, do something like this: