Query Counts based on multiple Query criteria

B

Basil

I have a Claims Table with fields: ptid, claimid, activityid, proc. Each
claimid can have multiple activityids, and each activityid has one proc.

I'm generating queries of this data as such:
-Query1: count of claims where proc =New (i.e. # of new ptid claims)
-Query2: count of claims where proc = Return (i.e. # of returning ptid claims,
each ptid could have multiple records in Query2)
-Query3: count of claims in Query2 where ptid is also in Query1 (i.e. count
the number of returning claims generated from ptids having new claims. This
will be used to calculate the % return claims generated from new patients.)
 
B

Basil

Sorry - this is my first posting and I left out the actual question. How do
I generate Query3 to get the records in Q2 where the ptid is also in Q1?
 
P

pietlinden

you can add both Query2 and Query3 to the QBE grid, and join on
Q2.ptid=Q1.ptid. The join will filter out all the records that don't
match.
 
B

Basil via AccessMonster.com

Thanks! You're right - the join gives me what I'm looking for. In setting
this up, I realized you can create the join using the unmatched query wizard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top