"fat" <sy*********@sybr.com.au> wrote in
news:11**********************@i39g2000cwa.googlegr oups.com:
Hi
I am trying to calculate Cost times Quanity but i also want to
calculate another field if the cost field is zero i have some
thing wrong, here is my code in the query
IIf([SundrySub]=0,nz([cost],0)*[Quanity]),IIf([SundrySub]
0,nz> ([Sundry],0)*[Quanity])
Formatting this gives me
IIf([SundrySub]=0, "the initial test"
nz([cost],0)*[Quanity] "value if test is true"
) "No value if test is false"
, "end of definition of value"
"We need to define this field's name"
Now start a new field definition
IIf([SundrySub]>0, " new test if first test is false"
nz([Sundry],0)*[Quanity] " Calculation for true"
) "No value if test is false"
I don't think this was your intent. Did you want the
value in one field, dependent on the conditions?
Try
..
IIf([SundrySub]=0,
nz([cost],0)*[Quanity],
IIf([SundrySub]>0,
nz([Sundry],0)*[Quanity]
)
)
And please learn how to spell quanTity.
--
Bob Quintal
PA is y I've altered my email address.