You need to nest them in the order you wish them to be tested: inside to
out:
Start by writing them in order, leaving the second argument blank until
the final test:
Nz([CGODL],)
Nz([CNL],)
Nz([PKMSOEL],)
Nz([PKMSOED],)
Nz([THED],[THEL])
See? Each Nz returns a single value that can be used as the second
argument of the prior test.
Now, copy the final test - Nz([THED],[THEL]) - into the second argument
of the prior one:
Nz([PKMSOED],Nz([THED],[THEL]))
This now becomes the final test, so copy it into the prior one:
Nz([PKMSOEL],Nz([PKMSOED],Nz([THED],[THEL])))
Repeat:
Nz([CNL],Nz([PKMSOEL],Nz([PKMSOED],Nz([THED],[THEL]))))
And finally:
Nz([CGODL],Nz([CNL],Nz([PKMSOEL],Nz([PKMSOED],Nz([THED],[THEL])))))
Just to be sure: count the parentheses ... the open parens should each
have a matching closing paren.
Ughhh ... but it works. Too bad the Jet team never implemented CASE or
COALESCE.
Hi, Dale.
How can I make Nz work for this scenario? Or can't it? I've tried
this and of course, it returns "Wrong number of arguments used."
Apparently Nz only works when a maximum of 2 fields are referenced...?
CSL: Nz([CGODL],[CNL],[PKMSOED],[PKMSOEL],[THED],[THEL])
Thanks!
--
www.Marzetti.com
Dale_Fye via AccessMonster.com said:
Or even simplier:
TotalWeightUOM: NZ([WeightUOM], [TotalWtUOM])
Dennis wrote:
TotalWeightUOM: IIf(IsNull([WeightUOM]),[TotalWtUOM],[WeightUOM])
[WeightUOM] and [TotalWeightUOM] are text fields. I'm trying to do
this:
[quoted text clipped - 8 lines]
Thanks for your help!
--
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.