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!

How do I change GSCHMIDT to Glenn Schmidt

Status
Not open for further replies.

jellybead

Technical User
Apr 30, 2004
13
US
I have a list of names that need to be changed to their full names. The database hold it by first inital, last name.

The formula I have right now is:
IF {PROJECT.MANAGER} = "DLEE" THEN "DIXIE LEE";
IF {PROJECT.MANAGER} = "EROTHE" THEN "EMMETT ROTHE";
IF {PROJECT.MANAGER} = "SPERRY" THEN "STEVE PERRY";
IF {PROJECT.MANAGER} = "MJACKSON" THEN "MAX JACKSON";
IF {PROJECT.MANAGER} = "GSCHMIDT" THEN "GLENN SCHMIDT";
IF {PROJECT.MANAGER} = "MCARNEVALE" THEN "MIKE CARNEVALE"

But it only recognizes MIKE CARNEVALE. CAn someone tell me what I'm doing wrong here?

Thanks, in advance, for your help. Jellybead

 
You need to end each line with an ESLE, not a ;
IF {PROJECT.MANAGER} = "DLEE" THEN "DIXIE LEE" else
IF {PROJECT.MANAGER} = "EROTHE" THEN "EMMETT ROTHE" else
IF {PROJECT.MANAGER} = "SPERRY" THEN "STEVE PERRY" else
IF {PROJECT.MANAGER} = "MJACKSON" THEN "MAX JACKSON" else
IF {PROJECT.MANAGER} = "GSCHMIDT" THEN "GLENN SCHMIDT" else
IF {PROJECT.MANAGER} = "MCARNEVALE" THEN "MIKE CARNEVALE"

With the ;'s Crystal treats each If Then as a seperate step. So even if DLEE is true, Crystal checks the {project>Manager} field again to to if it is EROTHE instead of exiting the formula. Since Mike is the last one on the list, his "true" stays.

Mike
 
mbarron

Thank you so much. I've been away from this for a little while and had forgotten.

It works great now!

Jellybead
 
Jellybead,
Was recently searching the Crystal 8.5 Help files for something and ran accross this technique below for If-then-else situations. Just a different approach to accomplish the same thing.

// If-Then-Else statements can now be replaced with with more readable easy to maintain logic.

Select {PROJECT.MANAGER}
CASE "DLEE": "DIXIE LEE"
CASE "EROTHE": "EMMETT ROTHE"
CASE "SPERRY": "STEVE PERRY"
CASE "MJACKSON": "MAX JACKSON"
CASE "GSCHMIDT": "GLENN SCHMIDT"
CASE "MCARNEVALE": "MIKE CARNEVALE"
Default: {PROJECT.MANAGER}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top