December 16, 2015 at 6:48 am
Hi.
I have zero experience writing code. I have been able to gleam some bits and pieces of default date parameters from some other sites when making a reports for last month or current week, etc.
What would be the default date parameters for the previous year? I want to set default start and end date so that on 1/1/2016, the recipients of the report receive a report for all of 2015 (1/1/2015 - 12/31/2015)
Many many thanks if you could just give me the start and end parameters for me to copy and paste.
December 16, 2015 at 8:20 am
Set your defaults as below:
Start
=DateAdd(DateInterval.Year, -1 , DateSerial(DatePart("yyyy",Today), 1, 1))
End
=DateAdd(DateInterval.Day, -1 , DateSerial(DatePart("yyyy",Today), 1, 1))
The DateSerial() determines the first day of the current year. Then either subtract one year or one day to get the start and end dates.
Scott
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply