Print zeros instead of blanks

upsman

Registered User.
Local time
Today, 07:32
Joined
Jul 22, 2005
Messages
26
Hello,

I'm using the following statement as the control source for a field on a report to calculate number of absences in a quarter.

Sum(IIf([NewAttendance].[Absent],1,0))

This works fine if a student has missed at least 1 day. But if they had perfect attendance that quarter, the field prints as a blank on the report. How do I get it to print a zero (0)? I tried Sum(NZ(IIf(....etc))) but that didn't work.

Thanks,
Rod
 
I am assuming that the absent field contains a 1 for absence and null for no absence
Sum(IIf([NewAttendance].[Absent],1,0))

Try this
Sum(IIf(IsNull[NewAttendance].[Absent]),0,[NewAttendance].[Absent])
 

Users who are viewing this thread

Back
Top Bottom