View Full Version : Date minus one month?


Jeni
07-02-2001, 03:39 AM
I want to produce a date in a report. It has to be the current month & year MINUS one month. I can format for current month and can do the current date minus one month but cannot get it to show only the month & year.
eg DateAdd("y",-25,[Text30]) where Text30 is =Format Date()("mmmm,yyyy")etc.Can I format the "=Format date " text box to simply take off one month?

Pat Hartman
07-02-2001, 05:40 AM
You need to do the calculation while the field is still a date, then format the result. The Format() function changes a field with a date data type to a string.

Format(DateAdd("y",-25,Date()),"mmmm,yyyy")

I copied your example to paste above. It doesn't agree with your posted question which was for current month minus 1 and I don't believe that it will work as you intend. I would use:

Format(DateAdd("m",-1,Date()),"mmmm,yyyy")