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!

Boolean Required Here 1

Status
Not open for further replies.

Shannon2008

Technical User
May 28, 2008
17
CA

//the formula below gives me an error of 'A Boolean is required here' on the last line following ELSE.
//What did I do wrong?
//I want the formula to return the value of (PRTIME.PAY_SUM_GRP} provided the other conditions do not exist.
//I tried two different ways of writing this, but keep getting the error. The second formula is scaled down.
[purpleface]

#1

local stringVar Array Prov_Worked;

IF {PRTIME.WC_STATE}=Prov_Worked THEN {PRTIME.PAY_SUM_GRP}<>'LOU'+
IF {PRTIME.WC_STATE}='BC'THEN {PRTIME.PAY_SUM_GRP}<>'BTC'+
IF {PRTIME.WC_STATE}='NB' THEN {PRTIME.PAY_SUM_GRP}<>'CAR'
ELSE IF ({PRTIME.WORK_STATE})<>Prov_Worked THEN {PRTIME.PAY_SUM_GRP}

#2

local StringVar Array Prov_Worked;

IF {PRTIME.PAY_SUM_GRP}='LOU'
THEN IF {PRTIME.WC_STATE}=Prov_Worked
THEN {PRTIME.PAY_SUM_GRP} = '0'
ELSE IF (({PRTIME.WC_STATE})<>Prov_Worked) THEN ({PRTIME.PAY_SUM_GRP})
 
I think you have over done the brackets

Try

ELSE IF (({PRTIME.WC_STATE})<>Prov_Worked THEN {PRTIME.PAY_SUM_GRP})

YOu had
) THEN (

Which I think is confusing your if statement.

Ian
 

//Thanks but now I get another error
//it wants a ) on THEN
//the error is 'The ) is missing'
//any idea?


local StringVar Array Prov_Worked;

IF {PRTIME.PAY_SUM_GRP}='LOU'
THEN IF {PRTIME.WC_STATE}=Prov_Worked
THEN {PRTIME.PAY_SUM_GRP} = '0'
ELSE IF (({PRTIME.WC_STATE})<>Prov_Worked THEN {PRTIME.PAY_SUM_GRP})

 
IF {PRTIME.PAY_SUM_GRP} = 'LOU' and
{PRTIME.WC_STATE} = 'Prov_Worked' THEN
'0' else
IF {PRTIME.WC_STATE} <> 'Prov_Worked' THEN {PRTIME.PAY_SUM_GRP}

Don't know what you want to do with this case though:

{PRTIME.PAY_SUM_GRP} <> 'LOU' and
{PRTIME.WC_STATE} = 'Prov_Worked'

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top