Count of records > 0

G

Guest

I am trying to write an expression in a report that gives the number of
records within a certain field that amount ot o more than zero. I have tried
several ways to make this work but I am getting errors instead of numbers. I
have tried:

= Count(IIf([PARVALUEB]>0,1,Null))
= Sum(IIf([PARVALUEB]>0,1,0))
= Abs(Sum([PARVALUEB]>0))

There has to be a simple solution. Can anyone give me some assistance?
 
F

fredg

I am trying to write an expression in a report that gives the number of
records within a certain field that amount ot o more than zero. I have tried
several ways to make this work but I am getting errors instead of numbers. I
have tried:

= Count(IIf([PARVALUEB]>0,1,Null))
= Sum(IIf([PARVALUEB]>0,1,0))
= Abs(Sum([PARVALUEB]>0))

There has to be a simple solution. Can anyone give me some assistance?

These should work:

= Sum(IIf([PARVALUEB]>0,1,0))
= Abs(Sum([PARVALUEB]>0))

Make sure the name of the control is NOT "PARVALUEB".
 
G

Guest

Thanks Fred, but these are not workng. The only 'control' that I know if is
the control source, where the expressions go. Where do I check the control?


fredg said:
I am trying to write an expression in a report that gives the number of
records within a certain field that amount ot o more than zero. I have tried
several ways to make this work but I am getting errors instead of numbers. I
have tried:

= Count(IIf([PARVALUEB]>0,1,Null))
= Sum(IIf([PARVALUEB]>0,1,0))
= Abs(Sum([PARVALUEB]>0))

There has to be a simple solution. Can anyone give me some assistance?

These should work:

= Sum(IIf([PARVALUEB]>0,1,0))
= Abs(Sum([PARVALUEB]>0))

Make sure the name of the control is NOT "PARVALUEB".
 
P

Pieter Wijnen

the actual name of the textbox whose controlsource you're playing with <g>
also make sure you do have a textbox for PARVALUEB in the report pointing to
the recordsource's field (not visible is fine)

Pieter

Pjdelchi said:
Thanks Fred, but these are not workng. The only 'control' that I know if
is
the control source, where the expressions go. Where do I check the
control?


fredg said:
I am trying to write an expression in a report that gives the number of
records within a certain field that amount ot o more than zero. I have
tried
several ways to make this work but I am getting errors instead of
numbers. I
have tried:

= Count(IIf([PARVALUEB]>0,1,Null))
= Sum(IIf([PARVALUEB]>0,1,0))
= Abs(Sum([PARVALUEB]>0))

There has to be a simple solution. Can anyone give me some
assistance?

These should work:

= Sum(IIf([PARVALUEB]>0,1,0))
= Abs(Sum([PARVALUEB]>0))

Make sure the name of the control is NOT "PARVALUEB".
 
G

Guest

No, the control is not named 'PARVALUEB.' I write the following expression
and get the right number, "=Count([PARVALUEB)", but I cannot seem to get a
result to tell me how many are greater than zero using the other expressions.


Any more ideas?

Phillip

Pieter Wijnen said:
the actual name of the textbox whose controlsource you're playing with <g>
also make sure you do have a textbox for PARVALUEB in the report pointing to
the recordsource's field (not visible is fine)

Pieter

Pjdelchi said:
Thanks Fred, but these are not workng. The only 'control' that I know if
is
the control source, where the expressions go. Where do I check the
control?


fredg said:
On Mon, 1 Oct 2007 10:15:01 -0700, Pjdelchi wrote:

I am trying to write an expression in a report that gives the number of
records within a certain field that amount ot o more than zero. I have
tried
several ways to make this work but I am getting errors instead of
numbers. I
have tried:

= Count(IIf([PARVALUEB]>0,1,Null))
= Sum(IIf([PARVALUEB]>0,1,0))
= Abs(Sum([PARVALUEB]>0))

There has to be a simple solution. Can anyone give me some
assistance?

These should work:

= Sum(IIf([PARVALUEB]>0,1,0))
= Abs(Sum([PARVALUEB]>0))

Make sure the name of the control is NOT "PARVALUEB".
 
F

fredg

No, the control is not named 'PARVALUEB.' I write the following expression
and get the right number, "=Count([PARVALUEB)", but I cannot seem to get a
result to tell me how many are greater than zero using the other expressions.


Any more ideas?

Phillip

Pieter Wijnen said:
the actual name of the textbox whose controlsource you're playing with <g>
also make sure you do have a textbox for PARVALUEB in the report pointing to
the recordsource's field (not visible is fine)

Pieter

Pjdelchi said:
Thanks Fred, but these are not workng. The only 'control' that I know if
is
the control source, where the expressions go. Where do I check the
control?


:

On Mon, 1 Oct 2007 10:15:01 -0700, Pjdelchi wrote:

I am trying to write an expression in a report that gives the number of
records within a certain field that amount ot o more than zero. I have
tried
several ways to make this work but I am getting errors instead of
numbers. I
have tried:

= Count(IIf([PARVALUEB]>0,1,Null))
= Sum(IIf([PARVALUEB]>0,1,0))
= Abs(Sum([PARVALUEB]>0))

There has to be a simple solution. Can anyone give me some
assistance?

These should work:

= Sum(IIf([PARVALUEB]>0,1,0))
= Abs(Sum([PARVALUEB]>0))

Make sure the name of the control is NOT "PARVALUEB".

OK, so have looked at the control's property sheet, on the OTHER tab,
and the Name of the control is not "PARVALUEB".

The next question is where in the report have you placed this control?
You cannot place it in the Report's Page Footer nor Page Header
section.
You can place it in the Detail section, or in a Group Header or Footer
section or in the Report Footer section.
 
P

Pieter Wijnen

then
= Abs(Sum(nz([PARVALUEB],0)>0))
or
= -Sum(Nz([PARVALUEB],0)>0)
should work (I suspect null values problem)

Pieter

Pjdelchi said:
No, the control is not named 'PARVALUEB.' I write the following
expression
and get the right number, "=Count([PARVALUEB)", but I cannot seem to get a
result to tell me how many are greater than zero using the other
expressions.


Any more ideas?

Phillip

Pieter Wijnen said:
the actual name of the textbox whose controlsource you're playing with
<g>
also make sure you do have a textbox for PARVALUEB in the report pointing
to
the recordsource's field (not visible is fine)

Pieter

Pjdelchi said:
Thanks Fred, but these are not workng. The only 'control' that I know
if
is
the control source, where the expressions go. Where do I check the
control?


:

On Mon, 1 Oct 2007 10:15:01 -0700, Pjdelchi wrote:

I am trying to write an expression in a report that gives the number
of
records within a certain field that amount ot o more than zero. I
have
tried
several ways to make this work but I am getting errors instead of
numbers. I
have tried:

= Count(IIf([PARVALUEB]>0,1,Null))
= Sum(IIf([PARVALUEB]>0,1,0))
= Abs(Sum([PARVALUEB]>0))

There has to be a simple solution. Can anyone give me some
assistance?

These should work:

= Sum(IIf([PARVALUEB]>0,1,0))
= Abs(Sum([PARVALUEB]>0))

Make sure the name of the control is NOT "PARVALUEB".
 

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