R
Ryan
I have a query with 4 fields, [Physician], [AccountNumber], [Charges], and
[CPTCODE]. Each account number can have multiple charges, so one account
number can be listed in 2 or more records. Each charge per account number
will have a different [CPTCODE]. What I need to produce is this.
Physician Total Patients Total Charges
DR Smith 52 10,000
DR James 72 80,000
DR Brian 85 90,000
To get the total patients I take only the [AccountNumber] and Group and
count it. Here is the tricky part. If the [CPTCode] = 80010, then I dont
want to see those accounts. The problem is that there can be multiple
[Charges] per [AccountNumber], with different [CPTCODES], but if one of
thoses [CPTCODES] = 80010, then I dont want to see any of the [Charges] for
that [AccountNumber].
I hope this makes sense, and any help or suggestions would be greatly
apprieciated. Thanks in advance.
--
[CPTCODE]. Each account number can have multiple charges, so one account
number can be listed in 2 or more records. Each charge per account number
will have a different [CPTCODE]. What I need to produce is this.
Physician Total Patients Total Charges
DR Smith 52 10,000
DR James 72 80,000
DR Brian 85 90,000
To get the total patients I take only the [AccountNumber] and Group and
count it. Here is the tricky part. If the [CPTCode] = 80010, then I dont
want to see those accounts. The problem is that there can be multiple
[Charges] per [AccountNumber], with different [CPTCODES], but if one of
thoses [CPTCODES] = 80010, then I dont want to see any of the [Charges] for
that [AccountNumber].
I hope this makes sense, and any help or suggestions would be greatly
apprieciated. Thanks in advance.
--