Default value = 0

P

Pedro

Hi everyone
Here's a dumb question but i can't find the answer. On my
report i have a field that sums all records. That qry is
made over a crosstab qry. That total field is summing
correctly but if there's no value on the records it shows
me blanks instead of zero. How can i put that field
showing me zeros when there's nothing to sum? My field
name is [QRY 1.Jan].
Tks in advance
Pedro
 
D

Duane Hookom

You can change your query so the value is something like:
TheValue: Val(Nz(Sum([YourField]),0))
Totals: Expression
 
P

Pedro

Duane,
Tks for your reply but ...
I know how to use the function NZ and i use it in a sum
field. I meant in a normal field like this one, Jan or
Feb, cose it's made of a crosstab qry and show's me every
month of the year on that report. Can i say for each month
to show me zero values if they're blank? I mean on the
properties of that text box?
Tks again very much
Pedro

-----Original Message-----
You can change your query so the value is something like:
TheValue: Val(Nz(Sum([YourField]),0))
Totals: Expression

--
Duane Hookom
MS Access MVP


Hi everyone
Here's a dumb question but i can't find the answer. On my
report i have a field that sums all records. That qry is
made over a crosstab qry. That total field is summing
correctly but if there's no value on the records it shows
me blanks instead of zero. How can i put that field
showing me zeros when there's nothing to sum? My field
name is [QRY 1.Jan].
Tks in advance
Pedro


.
 
D

Duane Hookom

The solution I provided would show zeros for every previously null value.
You can set the Format property of the text box to display a "0" if the
value is Null. Check Help on "Format Property - Numeric..."
--
Duane Hookom
Microsoft Access MVP


Pedro said:
Duane,
Tks for your reply but ...
I know how to use the function NZ and i use it in a sum
field. I meant in a normal field like this one, Jan or
Feb, cose it's made of a crosstab qry and show's me every
month of the year on that report. Can i say for each month
to show me zero values if they're blank? I mean on the
properties of that text box?
Tks again very much
Pedro

-----Original Message-----
You can change your query so the value is something like:
TheValue: Val(Nz(Sum([YourField]),0))
Totals: Expression

--
Duane Hookom
MS Access MVP


Hi everyone
Here's a dumb question but i can't find the answer. On my
report i have a field that sums all records. That qry is
made over a crosstab qry. That total field is summing
correctly but if there's no value on the records it shows
me blanks instead of zero. How can i put that field
showing me zeros when there's nothing to sum? My field
name is [QRY 1.Jan].
Tks in advance
Pedro


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top