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
where payrollran = 'no'
and I'm trying to get both a start date of the next available Sunday and also the start time of 12:00:00. I am able to get the next start date but not the time. Can anyone please assist?
Thank you
Doug