Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Syntax error with If statement - any help?

Avatar

22-07-2008

I asked a question last week that was admittedly unclear and didn't get an answer, so I figured out on my own how to get a form that works with this code below (first time attempting this):



If ((NumberPmts == 12) And (APR==21.00)) then (AmtFin2*.09313) elseif ((NumberPmts == 24) And (APR==21.00)) then (AmtFin2*.05142) elseif ((NumberPmts==36) And (APR==21.00)) then (AmtFin2*.03770) elseif ((NumberPmts==48) And (APR==21.00)) then (AmtFin2*.03099) elseif ((NumberPmts == 12) And (APR==17.99)) then (AmtFin2*.09170) elseif ((NumberPmts == 24) And (APR==17.99)) then (AmtFin2*.04994) elseif ((NumberPmts == 36) And (APR==17.99)) then (AmtFin2*.03616) elseif ((NumberPmts == 48) And (APR==17.99)) then (AmtFin2*.02938) endif



I'm sure there's an easier way to do that above, but the form seems to do exactly what calculations I want (and I'm not a code guru), so now, I'm trying to use that same format but add another variable (a field called Promo that contains different words). But now I'm getting a syntax error near token " on line 1 column 50. See below for what I have typed in (the first part only).



If ((NumberPmts==12) And (APR==17.99) And (Promo==STANDARD)) then (AmtFin2*.09170) elseif ((NumberPmts==24) And (APR==17.99) And (Promo==STANDARD)) then (AmtFin2*.04994) elseif ((NumberPmts==36) And (APR==17.99) And (Promo==STANDARD)) then (AmtFin2*.03616) elseif ((NumberPmts==48) And (APR==17.99) And (Promo==STANDARD)) then (AmtFin2*.02938) elseif ((NumberPmts==60) And (APR==17.99) And (Promo==STANDARD)) then (AmtFin2*.02540)endif



I appreciate any help. Thanks.