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

Count fields in Crystal Reports 9

Status
Not open for further replies.

Brian555

Technical User
Apr 29, 2005
20
GB
Please help

how do I count a number of fields that contain a value greater than zero
 
Hi,
You could create a formula that tests each number field -
@f1
If {table.field1} > 0 then 1 else 0


Do one like this for each field..Then create 1 more that adds them up:

@HowManyMoreThanZero
@f1 + @f2 + ....

Place these in your report..
and suppress the display of the individual ones..


[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Try posting technical information:

Database/connectivity used
Example data
Expected output

Another means might be to use something like:

numbervar MyCount:=0;
If {Customer.Customer ID} > 1 then
MyCount:=MyCount+1;
If {Customer.Customer Credit ID} > 1 then
MyCount:=MyCount+1;
etc...

But where are the counts displayed, in a group or a running total in the details, or???

-k
 
Sincere thanks to you both. I have used the suggestion by Turkbear and it has worked.

many thanks

Snoweyboy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top