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

Record Selection based on Loop Formula 1

Status
Not open for further replies.

shelby55

Technical User
Jun 27, 2003
1,229
CA
Hi

I apologize if there is a posting on this topic but the Search mode is currently undergoing maintenance so I can't access.

I have a relational database with a one-to-many relationship between abstracts and physicians i.e. there could be many physicians per abstract. In the physician database, there is a physician type, service, occurrence number and total occurrences per abstract as well as linking information such as chart number and account number. So if there are 3 physicians per an abstract, there would be occurrence 1 of 3, 2 of 3 and 3 of 3.

I want to select all abstracts where the initial occurrence (occur 1) is service type 10000 to 20000 and there is a subsequent physician type of 00000 to 00099 (2 to ?).

What would my selection formula be?

Thanks.

 
Sorry, I forgot to mention that I'm using a computer with Windows XP, SP 2 using CR9 accessing an Access XP database.

Shelby
 
First group on {table.abstract}. Then create two formulas in the formula editor:

//{@occur1}:
if {table.occur} = 1 and
{table.servicetype} in 10000 to 20000 then 1

//{@occurnot1}:
if {table.occur} <> 1 and
{table.phystype} in "00000" to "00099" then 1

Then go to report->edit selection formula->GROUP and enter:

sum(@occur1,{table.abstract}) > 0 and
sum({@occurnot1},{table.abstract}) > 0

-LB
 
Hi LB

Thanks so much, that did the trick!!

Shelby
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top