dateserial(year +/- value, month +/-value, day +/- value)
lets you add or subtract values, much like dateadd, to a date but you can add or subtract to the year,month and/or day in the same process.
This means that if you add 1 month to 12(december) it will move to Jan of the next year rather than crash as there is no month value of 13.
You can 'debug' by creating a formula to see what each of the dateserial() portions return
dateserial(year({?param}),1,1)
uses the year() function to get the year from the paramter date and the "1, 1" just sets the day and month to jan first so no matter whjat year the user enters into the param you will get Jan 1 of that year.
in this case date(year({?param}),1,1) would work just as well.
dateserial(year({?param}),month({?param})+1,1-1)
this gets the year from the param to set the year of the date,
then gets the month from the param and adds 1 month to it to move into the following month
the "1" sets the month day to 1 so now you have the first of the month that is following the parameter and the -1 subtracts one day from this date which gives you the last day of the month from the parameter entered
Edited by DBlank - 23 Mar 2015 at 4:59am