Can't get Nz function to work

Mike Hughes

Registered User.
Local time
Today, 15:08
Joined
Mar 23, 2002
Messages
493
I’m trying to figure out how to come up with the total number of cases in District WW which have an establishment type of P and a case type of A. When I run this query the results are showing as all blank fields in the table. My table has 4 columns, DO, P, A & CASES. I already know that the case count for this District would be 0 but I don’t understand why nothing is showing in any of the columns. I would expect DO column to be WW
P column to be P
A column to be A
Cases column to be 0
I have tried changing “Count(NOLDBA_INT_CASE_STATUS.CASE_ID) AS CASES” to
“=Nz([Count(NOLDBA_INT_CASE_STATUS.CASE_ID)],0) AS CASES” but all the columns continue to be blank.

Can anyone please tell me what I’m doing wrong?

QUERY:
SELECT
NOLDBA_INT_CASE_STATUS.IV_D_DO_CODE AS DO,
NOLDBA_INT_CASE_STATUS.ESTABLISH_TYPE AS P,
NOLDBA_INT_CASE_STATUS.CASE_TYPE AS A,
Count(NOLDBA_INT_CASE_STATUS.CASE_ID) AS CASES
FROM NOLDBA_INT_CASE_STATUS
GROUP BY NOLDBA_INT_CASE_STATUS.IV_D_DO_CODE, NOLDBA_INT_CASE_STATUS.ESTABLISH_TYPE, NOLDBA_INT_CASE_STATUS.CASE_TYPE
HAVING (((NOLDBA_INT_CASE_STATUS.IV_D_DO_CODE)=WW AND ((NOLDBA_INT_CASE_STATUS.ESTABLISH_TYPE)="P") AND ((NOLDBA_INT_CASE_STATUS.CASE_TYPE)="A"));
 
(NOLDBA_INT_CASE_STATUS.IV_D_DO_CODE)=WW

should be

(NOLDBA_INT_CASE_STATUS.IV_D_DO_CODE)="WW"
 

Users who are viewing this thread

Back
Top Bottom