Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date - (Month (CurrentDate)-1) 1

Status
Not open for further replies.

cretanion

Technical User
Jan 28, 2002
53
US
Running this for January 2008.

Date ((Year (CurrentDate)),(Month (CurrentDate)-1) ,Day (Maximum (LastFullMonth)))

Why am I getting, "a month number must be between 1 and 12?" I think I know the answer, 1-1=0, but why? How do I get around this?

I am trying to get the lastfullmonth data, which is December 2007. Do I set a datevar=Month(CurrentDate)-1 and do an IF THEN statement?

Thanks in advance for your help,
 
I believe you can change your formula to use DateSerial rather than Date and it should work:

DateSerial ((Year (CurrentDate)),(Month (CurrentDate)-1) ,Day (Maximum (LastFullMonth)))

But an easier solution is to just do this:

Maximum (LastFullMonth)

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top