Using (month(date)+2) errors out because of end of year

E

emailchrisco

I have a report where I use this syntax:
(month(date)+2)
to show some totals projected two months forward, but since it turned
November the adding of 2 months to the current month errors out the
report. How can I handle this?
 
E

emailchrisco

OP here.
I know I can use DateAdd to add 2 months to today's date, like this:
DateAdd("m", 2, date)
but I need something that will return the month's name, for example
"January"
Thanks for your help.
 
E

emailchrisco

OP here again.
Figured it out. I used DateAdd to get the date in this format 1/1/2007,
then used the Month() function to extract the month name from the
results of the DateAdd.
 
T

Tom Lake

OP here again.
Figured it out. I used DateAdd to get the date in this format 1/1/2007,
then used the Month() function to extract the month name from the
results of the DateAdd.

Or just use a Format on your display fields to display the month only.

Tom Lake
 

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