Two months earlier than current month

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
 
R

Rick Brandt

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.
 
L

Lars Brownies

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top