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!

Selecting a specific record in a Crystal formula

Status
Not open for further replies.

Delboy14

Programmer
Jun 21, 2001
213
GB
Crystal Reports 8.5 Access 2002

I have a Page in my report which displays a graph based on an Asthma Practice, the practice is chosen on a parameter called PracticeID. I would like to display the number of patients within THAT practice below the graph, how can I select that practice's number of patients from the table below, which is called Patients.

NumberOfPatients PracticeID
14 {404C9DA1-BAEF-11D4-9906-00001B3B43AB}
7 {4BA910E0-B4AD-11D4-A667-0010B5094D73}
5 {6AB78C40-C6D3-11D4-BF34-00B0D0183724}
7 {73180D01-C6C5-11D4-8D01-00500449A592}
8 {8537EF2D-9060-11D4-B0BB-00104BAFEAB4}
10 {9C3C1540-CABD-11D4-A0E2-0000E8D66B1D}
3 {C91195F0-D0E7-11D4-9BB3-000102DDFD08}
14 {DE21C8A0-B4C5-11D4-A184-00D0B7AFC0CF}
4 {F0C91195-11D4-D0E7-9BB3-02DD0001FD08}
12 BRAD01
11 BRAD02

I have tried formula's such as: if({Patients.PracticeID}like{?PracticeID}) then NumberOfPatients. this did not work, I have tried, using for loops, but found out that you cannot use for loops in crystal to travers through a list (which I think is ubelievable!). Can anyone guide/help me thanks alot. Derek
 
I would have thought that the if({Patients.PracticeID}like{?PracticeID}) then NumberOfPatients would work just fine. When entering in the PracticeID for the Parameter field, is a * being added to the end of the entry? Just a thought.
 
Does the chart currently work?
Are only Ashtma records making it into the report?
What is your selection formula? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
a) the chart works, unless I add the number of patients field, the gr
b) Sorry, I did not explain properly all records are related to asthma, my report is on asthma.
c) if({Paitents.PracticeID}like{?PracticeID}) then Patients.NumberOfPatients


 
a) how are you adding it?
c) This isn't a selection formula, a selection formula is boolean. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
a) I have tried adding it into the details section and into the page header beside the graph (which i did not think was correct but just tried it.) neither seemed to work.

c) I must not be using a selection formula should I where in the report and why?

Thanks
 
Report - Edit Selecton Formula- Record.

This tells CR which records to include. It is built by the Select expert. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
I think my problem is actually with the linking of my tables and queries, as this seems to be where the problem starts, I can select the practice correctly until I add another query to the report, this is where problems seem to occur as it does not recognise the fields of the query as being indexed, even if they are linked to an indexed field in a table.

I will work on this and post another question if this seems to be the problem thanks Derek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top