Lizzi McCarthy
Lizzi McCarthy

Reputation: 1

Crystal Report If formula with multiple conditions

I'm getting an error message with this formula but can't see the wood for the trees of what's missing - please help!

if {vehinv_rec.master_class_2} = "RCV" and if {vehinv_rec.chassis_model} in ["DF01", "DF02", "DF03", "DF04", "DF05", "DF06", "DF07", "DF08", "DF09", "DF10", "DF11", "DF12", "DF13", "DF14", "DF15", "DF16", "DF17", "DF18", "DF19", "DF20", "FAD2", "AN1", "AN2", "ANT", "ME4"] then "Uncompliant" else if {vehinv_rec.master_class_2} = "RCV" and {vehinv_rec.gvw_kg} > 18000 then "Compliant" else "Out of Scope"

I keep getting an error saying THEN is missing, but I can't see where?

Upvotes: 0

Views: 94

Answers (1)

R. McMillan
R. McMillan

Reputation: 1422

You have a syntax error. You wrote the formula as:

IF arg1 AND IF arg2 THEN...

Instead, try it as:

IF arg1 AND arg2 THEN...

When you repeated the keyword IF in the evaluation of arg2 the compiler/parser saw that as beginning a new IF statement without completing the first one.

Upvotes: 0

Related Questions