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!

Selecting the correct records

Status
Not open for further replies.

DBAMJA

Programmer
Jul 25, 2003
169
US
I am a rookie at CR 9.0 and I am pulling my hair out. What I need to do is select only those patients that were admitted three or more times last year. I am having difficulty trying to figure out where to count the number of admissions and qualify for >=3 admissions.

Probably an easy question but I just can't figure it out.

[flush]

DBAMJA

It is said that God will give you no more than you can handle. I just wish God didn't have so much faith in me.
 
Use a record selection formula that limits your records to last year, e.g.,

{table.date} in date(2004,01,01) to date(2004,12,31)

Then insert a group on {table.patientID}. Assuming you have a field {table.admissiondate}, go to edit selection formula->GROUP and enter:

distinctcount({table.admissiondate},{table.patientID}) >= 3

You will need to use running totals for calculations, since non-group selected records would still contribute to inserted summaries.

-LB
 
Thanks for the reply. I haven't had a chance to give it a try yet because I have been tied up on other projects. As soon as I get a chance to look at it, I will let you know how it worked.

Thanks

[flush]

DBAMJA

It is said that God will give you no more than you can handle. I just wish God didn't have so much faith in me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top