Mar 18, 2008 #1 cpagano Technical User Mar 14, 2008 12 US I want a query that always gathers its data for the last FULL month.. Ive tried this .. where adm_ts >= DATEADD(month,-1,GETDATE()) But it seems to go back 30 days from today, I need to run Feb in March, ect.. Thanks
I want a query that always gathers its data for the last FULL month.. Ive tried this .. where adm_ts >= DATEADD(month,-1,GETDATE()) But it seems to go back 30 days from today, I need to run Feb in March, ect.. Thanks
Mar 18, 2008 1 #2 tran008 Technical User May 14, 2003 110 US WHERE adm_ts >= DATEADD(MONTH, DATEDIFF(MONTH, 31, CURRENT_TIMESTAMP), 0), AND adm_ts < DATEADD(MONTH, DATEDIFF(MONTH, 0, CURRENT_TIMESTAMP), 0) Upvote 0 Downvote
WHERE adm_ts >= DATEADD(MONTH, DATEDIFF(MONTH, 31, CURRENT_TIMESTAMP), 0), AND adm_ts < DATEADD(MONTH, DATEDIFF(MONTH, 0, CURRENT_TIMESTAMP), 0)