Use of Nz over many fields

Chimp8471

Registered User.
Local time
Today, 09:40
Joined
Mar 18, 2003
Messages
353
is there an easier way to write this:

Total: Nz([C2])+Nz([CO])+Nz([F])+Nz([H0])+Nz([H3])+Nz([H4])+Nz([H5])+Nz([H6])+Nz([H9])+Nz([L])+Nz([N3])+Nz([NN])+Nz([P1])+Nz([P2])+Nz([P4])+Nz([P8])+Nz([Q])+Nz([S1])+Nz([UU])+Nz([X])

i just need to total all fields in my query, using the Nz function
 
Hi

To be honest i thought that the nz function was used to replace a null value i.e nz([TotalSales],0)
if totalsales is null then replace with 0.

If you want to total all the fields then you could lose the nz()'s you've added. If you genuinely need the nz function as i have described i don't think that you can use it across fields i.e nz([a]+,0) if you are expecting nulls in either of the fields selected, you would need nz([a],0)+nz(,0). But i'm willing to stand corrected.


Chris
 

Users who are viewing this thread

Back
Top Bottom