Page 1 of 1
IF, THEN, ELSE
Posted: Wed Jan 22, 2003 10:39 am
by ITSUPER
How can I check a field value and then multiply another field by 2 if it is the value I want? For example: I want to check if a value = 41, if it does then I want to multiply a corresponding field by 2 - I have tried - IIF (TEST_ID = 41, QTY*2), where test_id and qty are two different fields. I keep getting synatx errors. I am very new to RR and am desperatly seeking help. ____Thank__Kathy
=> RE: IF, THEN, ELSE
Posted: Wed Jan 22, 2003 12:49 pm
by kfleming
You are almost there. When you use the IIF() function you need to specify two return values, one for the true condition and one for the false. Both return values need to be the same data type.____So for your expression you could use:__IIF(TEST_ID = 41,QTY*2,QTY)____So for TEST_ID 41 it would return qty*2 otherwise it would be just qty.__Or you could use__IIF(TEST_ID = 41,QTY*2,0)__to return a zero as the false value.____Hope this helps.______Kathleen__R&R Support