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

please help with formula 1

Status
Not open for further replies.

CRuser89

Programmer
May 18, 2005
79
US
Hello everyone,

I have the following formula:

If {?Month} = '01' THEN {?Year} + '-' + 'Quar 3' else
If {?Month} = '04' THEN {?Year} + '-' + 'Quar 4' else
If {?Month} = '07' THEN {?Year} + 1 + '-' + 'Quar 1' else
If {?Month} = '10' THEN {?Year} + 1 + '-' + 'Quar 2'

The problem I'm having is with the 3rd and 4th if statements. I want if month parameters = 7 or 10 then for 1 to be added to the year parameter. So if a user entered month 07, year 2005, it would display 2006-Quar1. I hope this makes sense.

Thanks,
cruser89
 
It looks like both of your parameters are strings. You could use:

If {?Month} = '01' THEN {?Year} + '-' + 'Quar 3' else
If {?Month} = '04' THEN {?Year} + '-' + 'Quar 4' else
If {?Month} = '07' THEN totext(val({?Year})+1,0,"") + '-' + 'Quar 1' else
If {?Month} = '10' THEN totext(val({?Year})+1,0,"") + '-' + 'Quar 2'

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top