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!

Using a sub report to match clients with different record selection? 1

Status
Not open for further replies.

jaybar48

Technical User
Feb 16, 2002
61
US
Hi

I have a report that shows clients who were served by a group of 12 specific hospitals who had one medical visit in the past year in that hospital. The report gives the client ID, the type of medical misit and the visit date and groups the data by Hospital.

I them want to match those clients on their unique client identifier (the identifier is NOT hospital dependent) to see if they were served by any hospital other than the original 12 hospitals. This part of the report should show me the name of each of the other hospitals the client visited, the date of the visit and the visit type. Would this need to be done by a sub report? If so how might I do it.
 
A subreport makes sense in this case. I would insert a group on the client in the main report. Then create the subreport, adding the selection criteria that limits it to other hospitals, and then link the subreport to the main report on {table.clientID}. Place the subreport in the client group header or footer of the main report.

-LB
 
Thanks so much LB.

The 12 hospitals in the main report are selected via a parameter field that allows multiple selections.

How can I pass these to the sub report and maybe use the NOT clause, so the remaining hospital and healthcare centers are reflected in the election criteria for the sub report, without having to specify all 200 of the remaining ones?

Thanks

Jay

 
In the subreport, create a parameter like the one in the main report, e.g., {?hosp}, and add the following to the record selection criteria of the subreport:

not({table.hospital} = {?hosp})

Then in the main report, go to edit subreport links->move {?hosp} from the main report to the right as the main report link field, and from the dropdown list in the bottom left, choose {?hosp} (NOT the default {?pm-?hosp}).

That should do it.

-LB
 
LB

I am very confused. I though the linking field between the report and the sub report was the client ID?

Jay
 
You are just adding a link, so that you will have two links, one on client ID, and one on {?hosp}.

-LB
 
LB-

Since the values for the main and sub reports are identical, is there any want to enter them in the main report and have them pass to the sub report. The parameters have the sme names in both reports, but the selection criterial that use them are different.


Thanks,

Jay
 
If you have added the link on {?hosp} correctly, the parameter list will pop up only once--for the main report. Please explain what you have done, since it appears that you have not followed my above suggestions.

-LB
 
If you have added the link on {?hosp} correctly, the parameter list will pop up only once--for the main report. Please explain what you have done for your subreport selection criteria and for the subreport links.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top