George and DaveInIowa,
Thank you so much to both of you!!!
Both codes work well.
DaveInIowa's code is simple and easy. But like George mentioned, the data type of my timestamp is datatime, so subtract day might not get all data in that date.
So I will do
pp.timestamp >= DateAdd(Month, -3 +...
Hi,
I have a script that need to be run automatically in the first day of each month and get the previous 3 month data. How can I write a SQL expression to set the time range? For example, if the script runs on 5/1/2013, the data should include 02/01/2013 to 04/30/2013. Now I am doing it this...
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.