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

total or summary count

Status
Not open for further replies.

rynosims

Technical User
Nov 14, 2001
12
US
I need to add the total of several fields. Here are the database fieldsthat I have:
ARCRFT_CNTRL_STS.ARCRFT_STS_CD
This field has the following info:
FMC NMCMU NMCSU PMCS, etc...
ARCRFT_CNTRL_STS.ARCRAFT_TYP
This field has the following info:
C130E C009A C021A, etc...
ARCRFT_CNTRL_STS.ORIG_ID
This field has the following info:
86AW 145AW, etc...
What I need is a total count of all the 86AW C130E's that are FMC, PMCM, atc.
I have tried several formulas, and nothing works correctly.
Under the Select expert, I have
{ARCRFT_CNTRL_STS.ORG_ID} = "86AW"
My formula for the FMC aircraft is as follows:
if {ARCRFT_STS_CD.ARCRFT_STS_CD} = "fmc"
then count ({ARCRFT_CNTRL_STS.ARCRFT_STS_CD})
However, it adds all the aircraft together for a total of 49. With this formula, I get a count of 0:
if {ARCRFT_STS_CD.ARCRFT_STS_CD} = "fmc" and
{ARCRFT_CNTRL_STS.ARCRFT_TYP} = "c130e"
then count ({ARCRFT_CNTRL_STS.ARCRFT_STS_CD})
This is frustrating me to no end!!!
Do I need to change my selection expert, or rewrite my formulas? I do not know a lot about formula writing. I have ordered the Complete Reference for Crystal Reports 8 by George Peck from Amazon, and I am hoping that this will help me out. is this book any good? In the mean time, anyone care to take a stab at it?
I truly appreciate it!!
 
First the book is excellent. I hope you get v8.5 not v8.

Counts, Sums, averages, etc are typically not created using formulas in crystal. Try this. Create a formula field and concatenate the 2 or 3 fields in question, and place the concatenated field in the details section of the report. Then right click on the field and select insert summary. Make it a count summary. You're done.

You should not have to use the select expert unless you want certain records or groups to be on the report. If you write the report as I outlined, you will get a count of every combination of the 2 or 3 fields that exist in the database. If a combination is a valid combination but the database contains no records with that combination, it will not print out on the report at all, not even with a count of zero.

Let me know if you have any questions. Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top