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

Multiple record selection 2

Status
Not open for further replies.

bethany2

Programmer
Apr 5, 2002
3
0
0
US
I am trying to create a report that would eliminate all records of persons that have a source code of P after a certain date and/or persons with a interaction type of PH. For example:

Name Source Code Date Interaction
Mary A 03/2/2002
Mary P 02/7/2002 M
Mary AT 01/7/2002 OT
Pat 02/8/2002 TA
Pat H 03/3/2001 P
Jim AT 02/7/2002 PH
Jim H 02/7/2002 M

All Mary's records should be eliminated as well as Pat's
and should return only the one record of Jim's with the interaction of PH.

This has to be written in a Crystal Report and I could use someone to point me in the right direction...Temp Table?
Stored Procedure?
 
Hi,

I am not going to answer for ur question. I am having a doubt. I am having a report which shows the customer detail. At last i want to print the total no. of active customer and total no. of inactive customers separately.

Please help me

Very Urgent

Buhari
 
Buhari,
Very new to Crystal Reporting but could you put in a formula field using an IF statement? Something like:

If {table.active} = Y Then X Else O

Then right-clck table.active, choose Insert Summary. Count
table.active. Insert this new field in report footer.

 
Sorry,
I didn't really think this through before answering. Depending on how your report is set up, you may not be able to use the Insert Summary / Count as it would count all if the information is in the same column.
You would probably need to add a Count statement in your IF formula. If you give me an example, I could look at it.
 
Bethany-

No need for a SP or temp table, although you can do that if you wish. Write your report as it is laid out, and add two formula fields:

@SourcePTest
If {source}="P" then 1 else 0

@InteractionPHTest
If {InteractionType} = "PH" then 1 else 0

The group by name and summarize these 2 formula fields. Then in the group selection formula, put in the following:

Sum({Source},{name})= 0 or Sum({InteractionType},{name}) = 0

This will tottall exclude groups where there is an occurence like you described.

If you do not want the totals by name to appear, just suppress the group footer. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
buh, use a cross-tab with a column field of Active Status.

Bethany2, your question says to eliminate people with a PH, and then you say you only want to see the Jim's PH record. So I am a bit confused.

If you want to select or eliminate a group of records based on one record in the group you can write a formula like:

If {type} = "PH"
then 1
else 0

You then subtotal this formula for each group, and you can then put in a group selection formula that says:

Sum({formula},{Group}) = 1 // (or =0)

This will control the whole group based on any record in the group.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
I am new to crystal report.

I will give u an example.Actually, I am having a report which is grouped by Status like (Quoted, Enquiry,Job-Awarded) under which lot of groups are there. I want to print total number of enquiries, quoted, job-awareded separately at last ( that is, in the report footer)

Thanks in advance
Regards,
Buhari
 
Thank you both for responding and so fast. The tips you gave have helped a great deal.
 
You want summary totals ( a recap ) in the report footer. That is what cross-tabs will do. Insert a cross-tab and put the status field as the row field and as the summarized field. Put this into the report footer. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top