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!

Total problem 1

Status
Not open for further replies.

kernal

Technical User
Feb 27, 2001
415
US
I'm using crystal 9 and connecting to a mysql database:

Table (an ID can select as many answers as apply so the table data can look like the following):

id onea oneb onec
1 friend
2 safe quality
3 safe quality
4 quality
5 friend
6 safe
7 friend quality

Need the report to retrieve a total for each one" field and the user wants the report to look like:

friend 3
safe 3
quality 4

Help is appreciated
 
First, go into File->Report Options and check convert nulls to default values. Then place this in the detail section:

whileprintingrecords;
numbervar cntF;
numbervar cntS;
numbervar cntQ;
stringvar array k := [{table.onea},{table.oneb},{table.onec}];
numbervar i;
numbervar j := ubound(k);
for i := 1 to j do(
if 'Friend' in k then
cntF := cntF + 1;
if 'Safe' in k then
cntS := cntS + 1;
if 'Quality' in k then
cntQ := cntQ + 1;
);

Then in the report footer add a text box for each word, and add a separate formula for each count, as in:

whileprintingrecords;
numbervar cntF;

-LB
 
WONDERFUL! WONDERFUL! Thanks LB. Worked great!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top