G
Guest
I have a table PHP3014Rnew with the fields [Drug Desc], [Cardholder ID],
[NDC],[Formulary Flag], and [Claim Type]. Each [Drug Desc] may have more than
one [Cardholder ID] associated with it, since a patient may take a drug more
than once. I need to find the number of UNIQUE users of each drug. Here is my
SQL. I can't modify it to display the number of unique [Cardholder ID] for
each [Drug Desc]. Can someone help, please?
SELECT DISTINCT PHP3014Rnew.[Drug Desc], PHP3014Rnew.[Cardholder ID],
PHP3014Rnew.[NDC], PHP3014Rnew.[Formulary Flag], PHP3014Rnew.[Claim Type]
FROM PHP3014Rnew
GROUP BY PHP3014Rnew.[Drug Desc], PHP3014Rnew.[Cardholder ID],
PHP3014Rnew.NDC, PHP3014Rnew.[Formulary Flag], PHP3014Rnew.[Claim Type]
HAVING (((PHP3014Rnew.[Claim Type])="P"));
[NDC],[Formulary Flag], and [Claim Type]. Each [Drug Desc] may have more than
one [Cardholder ID] associated with it, since a patient may take a drug more
than once. I need to find the number of UNIQUE users of each drug. Here is my
SQL. I can't modify it to display the number of unique [Cardholder ID] for
each [Drug Desc]. Can someone help, please?
SELECT DISTINCT PHP3014Rnew.[Drug Desc], PHP3014Rnew.[Cardholder ID],
PHP3014Rnew.[NDC], PHP3014Rnew.[Formulary Flag], PHP3014Rnew.[Claim Type]
FROM PHP3014Rnew
GROUP BY PHP3014Rnew.[Drug Desc], PHP3014Rnew.[Cardholder ID],
PHP3014Rnew.NDC, PHP3014Rnew.[Formulary Flag], PHP3014Rnew.[Claim Type]
HAVING (((PHP3014Rnew.[Claim Type])="P"));