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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

logic help for months 1

Status
Not open for further replies.

mtdew

Technical User
Dec 9, 2007
77
US
Currently I have:

IIF (ISNULL([first_pmt_effective]),"1st Pay N/A",IIF([Age Days]<68,Month(now())+1&"/1 and newer",Month(now())&"/1 and older"))

and it works except when it is December, then I get a "13/1 and newer" result.

How else can I phrase this to just use the correct months?

In Excel I can use:

=IF(MONTH(A2)+1=13,IF(OR(ISBLANK(E2),E2=0),"1st Pay N/A",IF($C2<68,(MONTH(A2)+1)-12&"/1 and newer",MONTH(A2)&"/1 and older")),(IF(OR(ISBLANK(E2),E2=0),"1st Pay N/A",IF($C2<68,MONTH(A2)+1&"/1 and newer",MONTH(A2)&"/1 and older"))))
 

how about instead of:
[tt]
,Month(now())+1 & "/1 and newer",
[/tt]
you would have:
[tt]
,IIF(Month(now()) = 12, 1, Month(now())+1) & "/1 and newer",[/tt]

Code not tested.

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top