Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help in Counting values where greater than 0

Status
Not open for further replies.

neemi

Programmer
May 14, 2002
519
GB
I have a report based on a table with a lot of figures.

One of the fields in the table is the price of a car for example. What I need to do is get a count of this. in my report I have a field where I have set it to "=Count([Cost B/F]).

However this gives me the wrong number.

I want to count the records and give me a count where [Cost B/F] is greater than 0.

So in the table if I have 157 records with 120 that are greater than 0 the field in the report should be 120 and not 157 as I am getting.

Can anyone help with a quick easy way of achieving what I want.

Cheers in advance.

Neemi
 
If you want to still use Count try

=Count(IIf([Cost B/F]>0,1,"")).

I don't like to use "", so I usually use

=Sum(IIf([Cost B/F]>0,1,0)).

 
Thanks for your help tledwards!!

I don't know why I didnt think of that myself.

But cheers. Appreciated.

Neemi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top