insert 0 if null

Mike Hughes

Registered User.
Local time
Today, 17:16
Joined
Mar 23, 2002
Messages
493
I've read several posts and still can figure out where to put Nz([fieldname],0)

as somone suggested. I'm not sure if this is even correct. If the record count comes back null I want the query to insert a 0.

Here is the query:

SELECT
PA.DO,
NOLDBA_INT_CASE_STATUS.ESTABLISH_TYPE AS P,
NOLDBA_INT_CASE_STATUS.CASE_TYPE AS F,
Count(NOLDBA_INT_CASE_STATUS.CASE_ID) AS CASES INTO PF

FROM NOLDBA_INT_CASE_STATUS RIGHT JOIN PA ON NOLDBA_INT_CASE_STATUS.IV_D_DO_CODE = PA.DO

GROUP BY PA.DO, NOLDBA_INT_CASE_STATUS.ESTABLISH_TYPE, NOLDBA_INT_CASE_STATUS.CASE_TYPE, NOLDBA_INT_CASE_STATUS.CASE_STATUS

HAVING (((NOLDBA_INT_CASE_STATUS.ESTABLISH_TYPE)="P") AND ((NOLDBA_INT_CASE_STATUS.CASE_TYPE)="F") AND ((NOLDBA_INT_CASE_STATUS.CASE_STATUS)="O"));
 
is it possible to replace a null with a 0 when using the count function?
Could that be a problem?
 
Remember the Nz() function Mike? But if you want to count all, you can use Count(*)
 

Users who are viewing this thread

Back
Top Bottom