I currently have a report that prompts a user for a start date and end date. I would like to change that report to automatically use the last 3 months instead of prompting for dates.
Just a little tweak. You might want to use "to currentdate-1" or dateadd("m",-3, currentdate+1) so that you don't include an extra day.
Note also that dateadd only subtracts the number from the month value--it's not actually calculating number of days--and if the result doesn't exist (e.g., if you subtract 3 months from 5/31/2010, there is no 2/31/2010, and the result will show the nearest possible date, e.g., 2/28/2010. So it really depends upon what you mean by "month". If it is 30 days, then use currentdate-89 to currentdate.
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.