I need a query to select records using a DateTime field based on today's date without worrying about the current time.
I currently have
My problem is that I want to select full days, so if I run this at 11am on a Monday I want to bring back all records from the previous Monday, whereas this will bring back only those after 11am.
Essentially I want to change DATEADD(DAY,-7,GETDATE()) to represent midnight on the selected date, similarly for the end date.
Many thanks for your help.
I currently have
Code:
WHERE "Activity_Log"."Log_Date" BETWEEN DATEADD(DAY,-7,GETDATE()) AND DATEADD(DAY,-1,GETDATE())
My problem is that I want to select full days, so if I run this at 11am on a Monday I want to bring back all records from the previous Monday, whereas this will bring back only those after 11am.
Essentially I want to change DATEADD(DAY,-7,GETDATE()) to represent midnight on the selected date, similarly for the end date.
Many thanks for your help.