cancel
Showing results for 
Search instead for 
Did you mean: 

Need to make this formula for totals

Former Member
0 Kudos

this is really what I want to do for totaling. Can't work out the syntax.

IF {AEMPPF02.IDPRT#} <> 'FRTCMB' and {AEMPPF02.IDPRT#} <> 'FRTCME' then dd = dd + {AEMPPF02.EXTSHP}

Accepted Solutions (1)

Accepted Solutions (1)

former_member203168
Active Participant
0 Kudos

Numbervar dd;

if not({AEMPPF02.IDPRT#}) in [ "FRTCMB", "FRTCME"]

then

dd:=dd+{AEMPPF02.EXTSHP};

OR

IF (({AEMPPF02.IDPRT#} <> "FRTCMB")

OR ({AEMPPF02.IDPRT#} <> "FRTCME"))

then

dd:= dd + {AEMPPF02.EXTSHP}

--Praveen G

Former Member
0 Kudos

thanks, just one thing can I add this AND to it?

Numbervar dd;

IF (({AEMPPF02.IDPRT#} <> "FRTCMB")

OR ({AEMPPF02.IDPRT#} <> "FRTCME"))

AND {AEMPPF02.IDPRT#} like 'FRT*'

then

dd:= dd + {AEMPPF02.EXTSHP}

former_member203168
Active Participant
0 Kudos

You can Add AND in IFcondition.

Former Member
0 Kudos

You have the parenthesis right.  ((condition 1) OR (condition 2)) AND (condition 3)

I’m not sure “like ‘FRT*’” will work the way you want.
Try using STARTSWITH("FRT")

Answers (1)

Answers (1)

Former Member
0 Kudos

whileprintingrecords;
global numbervar dd;


IF ({AEMPPF02.IDPRT#} = 'FRTCMB')
OR ({AEMPPF02.IDPRT#} = 'FRTCME')
then dd:= dd

else dd:= dd + {AEMPPF02.EXTSHP}