J
js
Below is my query.
2 tables - Claims Data and Main Member Table
I need to run this query for the top 5 RHNs by count of
TCN (descending) in the Claims Data table by each PhysName
(Main Member table).
What do I change in this query to accomplish this? If I
simply do a Top 5, it does not do it by PhysName
Thanks,
js
SELECT [Claims Data].TCN, [MainMember table].MemberName,
[MainMember table].PhysName AS MostFreqPhys, [MainMember
table].RHN, [Claims Data].DrugName, [Claims
Data].PhysName, [Claims Data].Qty, [Claims Data].SrvDate,
[Claims Data].DaysSupply, [MainMember table].MemberDOB,
[MainMember table].CountofMeds, [MainMember table].Gender,
[Claims Data].PhysID
FROM [Claims Data] INNER JOIN [MainMember table] ON
[Claims Data].RHN = [MainMember table].RHN
WHERE ((([MainMember table].PhysName)=[Provider]) AND
(([MainMember table].CountofMeds)>7));
2 tables - Claims Data and Main Member Table
I need to run this query for the top 5 RHNs by count of
TCN (descending) in the Claims Data table by each PhysName
(Main Member table).
What do I change in this query to accomplish this? If I
simply do a Top 5, it does not do it by PhysName
Thanks,
js
SELECT [Claims Data].TCN, [MainMember table].MemberName,
[MainMember table].PhysName AS MostFreqPhys, [MainMember
table].RHN, [Claims Data].DrugName, [Claims
Data].PhysName, [Claims Data].Qty, [Claims Data].SrvDate,
[Claims Data].DaysSupply, [MainMember table].MemberDOB,
[MainMember table].CountofMeds, [MainMember table].Gender,
[Claims Data].PhysID
FROM [Claims Data] INNER JOIN [MainMember table] ON
[Claims Data].RHN = [MainMember table].RHN
WHERE ((([MainMember table].PhysName)=[Provider]) AND
(([MainMember table].CountofMeds)>7));