E
ecwhite
Hello,
Please help, i am out of ideas.
I have a query that i am pulling list of patients in certain DRG Codes (Data
Type is Number), i list the DRG Codes that i am interested in under the query
criteria. I also have a secound layer that i use built off the 1st query just
to show a count of patients in each DRG Group and i displayed how it looks
below
my query looks like this, please note i had to use like in query instead of
"IN() because i don't get data with "IN('34','35',....).
SELECT A.BI_ID, A.DG_COD, D.DRG_DESC, P.DISCH_DATE
FROM ([Admi] AS A INNER JOIN [PT] AS P ON (A.HOSP_ID = P.HOSP_ID) AND
(A.PT_ID = P.PT_ID)) INNER JOIN [DG Ref] AS D ON A.DG_COD = D.DG_COD
WHERE (((P.DIS_DATE) Between #10/1/2007# And #12/31/2007#))
GROUP BY A.BI_ID, A.DG_CODE, D.DG_DESC, P.DISCH_DATE
HAVING (((A.DG_COD) Like 34 Or (A.DG_COD) Like 35 Or (A.DG_COD))))
ORDER BY A.BI_ID;
Problem:
I want if there is no patient for DRG 34, Let DRG 34 show up on my list with 0
That way when i do a count of all the patients in different DRG groups, it
will show up as 0 like this in my second query.
Result from second query that only does count
DRG DRG DESC Count
34 iv 0
35 test 10
37 test 0
50 test 200
Thanks for all your help.
Please help, i am out of ideas.
I have a query that i am pulling list of patients in certain DRG Codes (Data
Type is Number), i list the DRG Codes that i am interested in under the query
criteria. I also have a secound layer that i use built off the 1st query just
to show a count of patients in each DRG Group and i displayed how it looks
below
my query looks like this, please note i had to use like in query instead of
"IN() because i don't get data with "IN('34','35',....).
SELECT A.BI_ID, A.DG_COD, D.DRG_DESC, P.DISCH_DATE
FROM ([Admi] AS A INNER JOIN [PT] AS P ON (A.HOSP_ID = P.HOSP_ID) AND
(A.PT_ID = P.PT_ID)) INNER JOIN [DG Ref] AS D ON A.DG_COD = D.DG_COD
WHERE (((P.DIS_DATE) Between #10/1/2007# And #12/31/2007#))
GROUP BY A.BI_ID, A.DG_CODE, D.DG_DESC, P.DISCH_DATE
HAVING (((A.DG_COD) Like 34 Or (A.DG_COD) Like 35 Or (A.DG_COD))))
ORDER BY A.BI_ID;
Problem:
I want if there is no patient for DRG 34, Let DRG 34 show up on my list with 0
That way when i do a count of all the patients in different DRG groups, it
will show up as 0 like this in my second query.
Result from second query that only does count
DRG DRG DESC Count
34 iv 0
35 test 10
37 test 0
50 test 200
Thanks for all your help.