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

If statement does not recognize values

Status
Not open for further replies.

jpreciado

MIS
Feb 7, 2004
36
MX
I have this formula:

IF {Uco.Uperiod}>=3 then
If ToNumber({Eag.Evalue_3}) > 0 then
{Eag.EValue_3}
ELSE
IF Ucase({Eal.Evalue}) = 'NO' AND {Uco.Uperiod}=3 Then
'ADM'
Else
IF Ucase({Eal.ERight}) = 'NO' AND {Eag.No_Right_ag} = True AND {Uco.Uperiod}=3 Then
'F/A'
Else
IF Ucase({Eal.ERight}) <> 'NO' AND {Eag.Evalue1} = True AND {Uco.Uperiod}=3 Then
'FAL'
ELSE
''

It doesnt recognize this IF secuence. plase tell me what is wrong with this.
 
You have a nested if here, and I cannot tell what your intent is, and therefore CR can't either. Use parentheses to set off the appropriate clauses. Not sure whether you mean:

IF {Uco.Uperiod}>=3 then
(
If ToNumber({Eag.Evalue_3}) > 0 then
{Eag.EValue_3}
ELSE
IF Ucase({Eal.Evalue}) = 'NO' AND {Uco.Uperiod}=3 Then
'ADM'
Else
IF Ucase({Eal.ERight}) = 'NO' AND {Eag.No_Right_ag} = True AND {Uco.Uperiod}=3 Then
'F/A'
Else
IF Ucase({Eal.ERight}) <> 'NO' AND {Eag.Evalue1} = True AND {Uco.Uperiod}=3 Then
'FAL'
ELSE
''
)

Or, whether you mean:

IF {Uco.Uperiod}>=3 then
(
If ToNumber({Eag.Evalue_3}) > 0 then
{Eag.EValue_3}
)
ELSE
IF Ucase({Eal.Evalue}) = 'NO' AND {Uco.Uperiod}=3 Then
'ADM'
Else
IF Ucase({Eal.ERight}) = 'NO' AND {Eag.No_Right_ag} = True AND {Uco.Uperiod}=3 Then
'F/A'
Else
IF Ucase({Eal.ERight}) <> 'NO' AND {Eag.Evalue1} = True AND {Uco.Uperiod}=3 Then
'FAL'
ELSE
''

Or you might mean something else, so adding the parentheses should solve the problem, I think.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top