Then, it seems the following should work:
Nz(UNNtWtConvlb , UNNtWtConvgal * Nz(INGDenlbgal , FADenlbgal ))
Vanderghast, Access MVP
Thanks, Bob and Michel! I should've seen this but I was brain-locked.
I actually have one other argument and some rounding:
UNNtWt: IIf([UNNtWtConvlb]<>0,Round([UNNtWtConvlb],
4),IIf([UNNtWtConvgal]<>0,Round(Nz([INGDenlbgal],
[FADenlbgal]*[UNNtWtConvgal]),4)))
I have two scenarios:
1. A record has either a UNNtWtConvlb or a UNNtWtConvgal but can never
have both.
2. If a record has UNNtWtConvlb then return it.
3. If a record has UNNtWtConvgal then multiply it by either
INGDenlbgal or FADenlbgal (can never have both).
Thanks so much for the boost!
UNNtWt: IIf([UNNtWtConvgal],Nz([INGDenlbgal],
[FADenlbgal]*[UNNtWtConvgal]))
This returns a value only if a UNNtWtConvgal is a whole number.
Does anybody see why this is? Have I done something wrong with Nz? I
simply want to calculate INGDenlbgal or FADenlbgal with UNNtWtConvgal
if it has a value.
You are treating UNNtWtConvgal as if it were a boolean value (true or
false), which is not a good idea. Try
UNNtWt: IIf([UNNtWtConvgal] <> 0,
Nz([INGDenlbgal],[FADenlbgal]*[UNNtWtConvgal]))
You also should supply the <falsepart> argument to the iif method:
UNNtWt: IIf([UNNtWtConvgal] <> 0,
Nz([INGDenlbgal],[FADenlbgal]*[UNNtWtConvgal]),
0)
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.- Hide quoted text -
- Show quoted text -