Hi Thwack community
I´m using these sql expressions to get date like below:
Last 30 days
BETWEEN dateadd(month, -1, getdate()) and getdate()
This month
DateTime between (DATEADD(m, DATEDIFF(m, 0, getdate()) , 0)) AND (DATEADD(dd, DATEDIFF(dd,0, getdate()), 0))
Last Month
DateTime between (DATEADD(m, DATEDIFF(m, 0, getdate()) -1 , 0)) AND (DATEADD(m, DATEDIFF(m, 0, getdate()) , 0))
Yesterday
DateTime BETWEEN (DATEADD(dd, DATEDIFF(dd,0, getdate()) -1, 0)) AND (DATEADD(dd, DATEDIFF(dd,0, getdate()) , 0)))
I´m looking for sql expressions to get:
this year
last year
last 7 days
Thanks a lot