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

If Else??? Formula Help

Status
Not open for further replies.

paulcook

MIS
May 28, 2003
22
CA
I am starting to work on slightly more complicated formulas now so I need the experts help.

I need a formula that checks a field in a table and prints 'In' or 'Out' depending on the contents.

Version: Crystal Reports 8.5
table name: app

If app.educ_stat is equal to '1' or '5' then the field on the report should read 'In'.

If app.educ_stat is equal to '3' or '4' the the field should read 'Out'

If app.educ_stat is equal to '2' then I need to check app.basic_skill_defcnt and if that field is equal to '1' then the field on the report should read 'In'

I am not quite sure whether to use If...Else If? Also is any of my vocabulary is off, incorrect use of field, please let me know.

TIA,
Paul
 
I think this is what you are looking for...

IF ({app.educ_stat} = 1 OR {app.educ_stat} = 5) THEN "In"
ELSE
IF ({app.educ_stat} = 3 OR {app.educ_stat} = 4) THEN "Out"
ELSE
IF ({app.educ_stat} = 2 AND {app.basic_skill_defcnt} = 4) THEN "In"
ELSE "Out"
 
MJRBIM,

Thank you! That solution worked perfectly and was very informative as to how to create formulas in Crystal. I will make sure to keep it handy for future reference.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top