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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting total of certain records

Status
Not open for further replies.

bdm1

Programmer
Feb 4, 2002
75
US
I have a report and need a total of all the records and then a total of just certain records. In the report header I inserted an unbound text box with =Count(*). This works fine in counting all of the records. Now I also need a count of those records that have no SubscriberID. So in another unbound text box I have =Count([SubscriberID]=0). But it does not work. I still get a count of all the records. How can I get it to give me a count of just those records with no SubscriberID? Thanks much..
 
Almost there. Try
=Abs(Sum([SubscriberID]=0))

That should do it assuming your SubscriberID is 0 and not Null.

Paul
 
Hi Paul (that is St. Paul) IT works!!!!!Thanks much. Don't know what the abs is all about but I'll sure look it up....thanks again
 
The Abs() function returns a positive value for either positive or negative numbers. So Abs(-1) = 1 and Abs(1) = 1
SubscriberID = 0 returns a boolean value (true or false), either 0 or -1 usually (sometimes 0 and 1). Summing 0's and 1's is the same thing as counting and the Abs() function converts the answer to a positive value.
HTH

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top