Date minus one month? (1 Viewer)

J

Jeni

Guest
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

Super Moderator
Staff member
Local time
Today, 09:28
Joined
Feb 19, 2002
Messages
42,981
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")
 

Users who are viewing this thread

Top Bottom