I have the following query:
select MAX(payrolldate ) AS [payrolldate], dateadd(dd, ((datediff(dd, '17530107', MAX(payrolldate ))/7)*7)+7, '17530107') AS [Sunday] from dbo.payroll
and it's currently showing me from Sunday at 12:00 am through the following Sunday at 12:00 am and I need it to show me from Sunday at midnight to Saturday at midnight. I've tried to adjust this but I am obviously missing something. Can someone please assist me on this?
Thanks
Doug
select MAX(payrolldate ) AS [payrolldate], dateadd(dd, ((datediff(dd, '17530107', MAX(payrolldate ))/7)*7)+7, '17530107') AS [Sunday] from dbo.payroll
and it's currently showing me from Sunday at 12:00 am through the following Sunday at 12:00 am and I need it to show me from Sunday at midnight to Saturday at midnight. I've tried to adjust this but I am obviously missing something. Can someone please assist me on this?
Thanks
Doug
Comment