totals query does not show zero and currency format (1 Viewer)

smile

Registered User.
Local time
Yesterday, 18:30
Joined
Apr 21, 2006
Messages
212
Hi, I have simple totals query. I take my data from another query and use Sum to total it.

I need to display 0 if nothing to total.
I need to format as currency, tried to select it from property sheet does not work.

I have made it work by editing SQL:

SELECT CCur(Nz(Sum(my_query_ name.SumOf_myfieldname),0)) AS sum of _myfieldname
FROM my_query_ name_group;

I had to use CCur() and Nz(), why normal way expr1: nz([sumof_myfieldname]);0) does not work? It's shown as expression now.
 

raskew

AWF VIP
Local time
Yesterday, 20:30
Joined
Jun 2, 2001
Messages
2,734
Hi -

Try changing:

nz([sumof_myfieldname]);0)

to:

nz([sumof_myfieldname],0)

Bob
 

smile

Registered User.
Local time
Yesterday, 18:30
Joined
Apr 21, 2006
Messages
212
Hi -

Try changing:

nz([sumof_myfieldname]);0)

to:

nz([sumof_myfieldname],0)

Bob

I entered:
total: Nz([sumof_myfieldname];0)

but no zero if my value is null.

your code genreates this sql:
SELECT Sum(Nz([SumOf_myfieldname],0)) AS total
FROM my_query_ name_group;

my working sql but shown as expression:
SELECT CCur(Nz(Sum(my_query_ name_group.SumOf_myfieldname),0)) AS total
FROM my_query_ name_group;

I would like to avoid using expression
 
Last edited:

Users who are viewing this thread

Top Bottom