Functions

change current date to past date

DATEADD(DAY, -30, GETDATE())  -- this will set date to previous 30 days