Page 1 of 1

last day(#) of month

Posted: Wed Mar 02, 2011 12:55 pm
by patelxyz
How can I create a variable to set a last day of last month. I need to change file name from "current file" to "new file name_ 02-28-2011".
Any help is appreciated

last day(#) of month

Posted: Tue Mar 08, 2011 11:37 pm
by Oleg
I think you can do this with BASIC.
In order to calculate last date in previous month you should subtract 1 from 1-st date of current month.

Basic expression:
DateSerial(Year(Date), Month(date),1) - 1

Also see this example

This task requires Basic plugin. You can download it here.

last day(#) of month

Posted: Fri Mar 25, 2011 4:40 am
by rknight10
That works great!
I needed the month code to always be 2 chars long. (Leading zero if needed) So I added:
Right("0" & cstr(month(Date)-1),2)
I share this in case it helps someone.
Thanks,
Rob