Non Zero

  • Thread starter ladybug via AccessMonster.com
  • Start date
L

ladybug via AccessMonster.com

I have a field on a report the control source is =(Sum([SumOfintDist_Orders]))

I want if the entry is blank to return "0" (zero). How do I do this? Is
this in the report or the query?
 
S

Stefan Hoffmann

hi,
I have a field on a report the control source is =(Sum([SumOfintDist_Orders]))

I want if the entry is blank to return "0" (zero). How do I do this? Is
this in the report or the query?
Blank normally means Null. Thus try

=Nz(Sum(), 0)


mfG
--> stefan <--
 
P

Paolo

Hi ladybug,

=NZ(Sum([SumOfintDist_Orders]))
will return 0 if (Sum([SumOfintDist_Orders])) is null

HTH Paolo
 
L

ladybug via AccessMonster.com

Sorry, do I put this in the report or query? If the query, in the criteria
or a new field? Sorry, I do not understand. I appreciate the help.
Hi ladybug,

=NZ(Sum([SumOfintDist_Orders]))
will return 0 if (Sum([SumOfintDist_Orders])) is null

HTH Paolo
I have a field on a report the control source is =(Sum([SumOfintDist_Orders]))

I want if the entry is blank to return "0" (zero). How do I do this? Is
this in the report or the query?
 
K

Klatuu

Put it in the report. It is much faster then doing it in the query.
Make your control source for the control it is bound to:
=Sum(NZ([SumOfintDist_Orders],0))
--
Dave Hargis, Microsoft Access MVP


ladybug via AccessMonster.com said:
Sorry, do I put this in the report or query? If the query, in the criteria
or a new field? Sorry, I do not understand. I appreciate the help.
Hi ladybug,

=NZ(Sum([SumOfintDist_Orders]))
will return 0 if (Sum([SumOfintDist_Orders])) is null

HTH Paolo
I have a field on a report the control source is =(Sum([SumOfintDist_Orders]))

I want if the entry is blank to return "0" (zero). How do I do this? Is
this in the report or the query?
 
P

Paolo

In the report, instead of comma use the semicolon to separate the name of the
field and the zero:
=Sum(NZ([SumOfintDist_Orders];0))

Cheers

Klatuu said:
Put it in the report. It is much faster then doing it in the query.
Make your control source for the control it is bound to:
=Sum(NZ([SumOfintDist_Orders],0))
--
Dave Hargis, Microsoft Access MVP


ladybug via AccessMonster.com said:
Sorry, do I put this in the report or query? If the query, in the criteria
or a new field? Sorry, I do not understand. I appreciate the help.
Hi ladybug,

=NZ(Sum([SumOfintDist_Orders]))
will return 0 if (Sum([SumOfintDist_Orders])) is null

HTH Paolo

I have a field on a report the control source is =(Sum([SumOfintDist_Orders]))

I want if the entry is blank to return "0" (zero). How do I do this? Is
this in the report or the query?
 
K

Klatuu

That is not correct. It should be a comma.
--
Dave Hargis, Microsoft Access MVP


Paolo said:
In the report, instead of comma use the semicolon to separate the name of the
field and the zero:
=Sum(NZ([SumOfintDist_Orders];0))

Cheers

Klatuu said:
Put it in the report. It is much faster then doing it in the query.
Make your control source for the control it is bound to:
=Sum(NZ([SumOfintDist_Orders],0))
--
Dave Hargis, Microsoft Access MVP


ladybug via AccessMonster.com said:
Sorry, do I put this in the report or query? If the query, in the criteria
or a new field? Sorry, I do not understand. I appreciate the help.

Paolo wrote:
Hi ladybug,

=NZ(Sum([SumOfintDist_Orders]))
will return 0 if (Sum([SumOfintDist_Orders])) is null

HTH Paolo

I have a field on a report the control source is =(Sum([SumOfintDist_Orders]))

I want if the entry is blank to return "0" (zero). How do I do this? Is
this in the report or the query?
 
P

Paolo

Hi Klatuu,
I don't want to bother you insisting, but in my Access (2k) if I use the
expression with the comma in the control source it raises an error (i.e. "The
expression you entered contains invalid sintax"), with the semi colon it
works correctly.
If we are speaking of VBA I agree with you.

Cheers Paolo

Klatuu said:
That is not correct. It should be a comma.
--
Dave Hargis, Microsoft Access MVP


Paolo said:
In the report, instead of comma use the semicolon to separate the name of the
field and the zero:
=Sum(NZ([SumOfintDist_Orders];0))

Cheers

Klatuu said:
Put it in the report. It is much faster then doing it in the query.
Make your control source for the control it is bound to:
=Sum(NZ([SumOfintDist_Orders],0))
--
Dave Hargis, Microsoft Access MVP


:

Sorry, do I put this in the report or query? If the query, in the criteria
or a new field? Sorry, I do not understand. I appreciate the help.

Paolo wrote:
Hi ladybug,

=NZ(Sum([SumOfintDist_Orders]))
will return 0 if (Sum([SumOfintDist_Orders])) is null

HTH Paolo

I have a field on a report the control source is =(Sum([SumOfintDist_Orders]))

I want if the entry is blank to return "0" (zero). How do I do this? Is
this in the report or the query?
 
S

Stuart McCall

Paolo said:
Hi Klatuu,
I don't want to bother you insisting, but in my Access (2k) if I use the
expression with the comma in the control source it raises an error (i.e.
"The
expression you entered contains invalid sintax"), with the semi colon it
works correctly.
If we are speaking of VBA I agree with you.

Cheers Paolo

It sounds like you are using a non-English Access.

Go to Control Panel->Regional and language options, then click the customize
button. Look for 'list separator'. My bet is it is a semicolon. You can
change it to a comma if you want. Bear in mind, however, that any semicolons
in control properties of your existing apps will now be broken.
 
P

Paolo

Yes, that's true, I'm using a non english Access and I never changed the
default setting for list separator.
So that I apologise with Klatuu who was correct and I thank you for the
explanation for our misunderstanding...

HAND Paolo
 
Top