I'm working on a form to prompt for report parameters and run a report. The report has Begin and End dates (and uses popup calendar learned here, thank you). I know that accounting will usually run this report as part of their closing process (the first few days of the next month), therefore, the begin and end dates will be the 1st and last days of the prior month.
The End Date is easily calculated:
End Date =DateSerial(Year(Now()),Month(Now()),1)-1
*Get to the beginning of the current month and subtract one day.
The Begin Date gets a little complex, to calculate Year and Month I use the End Date formula, then use "1" for the first day of the month.
Begin Date =DateSerial(Year(DateSerial(Year(Now()),Month(Now()),1)-1), Month(DateSerial(Year(Now()),Month(Now()),1)-1),1)
Anyone have another technique, especially one that may be easier?
The End Date is easily calculated:
End Date =DateSerial(Year(Now()),Month(Now()),1)-1
*Get to the beginning of the current month and subtract one day.
The Begin Date gets a little complex, to calculate Year and Month I use the End Date formula, then use "1" for the first day of the month.
Begin Date =DateSerial(Year(DateSerial(Year(Now()),Month(Now()),1)-1), Month(DateSerial(Year(Now()),Month(Now()),1)-1),1)
Anyone have another technique, especially one that may be easier?