Two months earlier than current month

  • Thread starter Thread starter Lars Brownies
  • Start date Start date
L

Lars Brownies

In a calculated field I'm using:

=MonthName(Month(DateAdd("m";-2;Date())))

to get the name of the month, two months earlier than the current month.

Is there a easier/better way to get the same result?

Thanks,

Lars
 
Lars said:
In a calculated field I'm using:

=MonthName(Month(DateAdd("m";-2;Date())))

to get the name of the month, two months earlier than the current month.

Is there a easier/better way to get the same result?

Depends on what you mean by "easier". This method...

=Format(DateAdd("m";-2;Date()),"mmmm")

....uses three function calls instead of four and saves typing a few
characters. Whether that is easier is a matter of opinion, but generally
speaking fewer function calls is better if the same result an be achieved.
 
I certainly like that one better!

Thanks.
Lars

Rick Brandt said:
Depends on what you mean by "easier". This method...

=Format(DateAdd("m";-2;Date()),"mmmm")

...uses three function calls instead of four and saves typing a few
characters. Whether that is easier is a matter of opinion, but generally
speaking fewer function calls is better if the same result an be achieved.
 
Back
Top