The below works in SQL Server but need it in DB2. Looking for two dates - last Sunday of previous month and last Saturday of current month.
SELECT DATEADD(day, DATEDIFF(day,'1900-01-07', DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE() - 30),30))/7*7,'1900-01-07') AS LAST_SUNDAY_PREVIOUS_MONTH...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.