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!

using if - then - else with 'text'

Status
Not open for further replies.

damselx

Technical User
Apr 24, 2003
32
AU
Hi

I'm trying to do a if - then - else with text but not sure what my else should be

Can someone please help as if I put 0 it says it needs a boolean here

Thanks
Helen

if {DRSTRAN.SALES_CODE} = "49"
then 'David'
or
if {DRSTRAN.SALES_CODE} = "46"
then 'Werner'
or
if {DRSTRAN.SALES_CODE} = "42"
then 'Peter'
or
if {DRSTRAN.SALES_CODE} not ["49","46","42"]
then 'Others'
else
 
Change your code as follows:

if {DRSTRAN.SALES_CODE} = "49"
then 'David'
else
if {DRSTRAN.SALES_CODE} = "46"
then 'Werner'
else
if {DRSTRAN.SALES_CODE} = "42"
then 'Peter'
else 'Others'

Also, how are you creating this formula? Make sure you click on insert, field object, formula field to create this formula.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
Thankyou ... fixed it perfectly
Helen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top