Re: Counting blanks fields for a report



You may need to use IIf() to prevent division by 0.

IIf(Sum(IIf([Test1]="y",1,0))=0,0, 18/ Sum(IIf([Test1]="y",1,0))

--
Duane Hookom
MS Access MVP


"Robin Chapple" <address@xxxxxxxxxxxxx> wrote in message
news:sermh1tq1ut7fl6iin2bl3hspan8gea39c@xxxxxxxxxx
>
> I have not applied this correctly/
>
> I have used each of your suggestions and each gives me the result:
> #Div.0!
>
> Here are the complete pieces of code:
>
> ="18 =" & Format((18/(Sum(Abs(IsNull([Status])))*100),"#.##") & "%"
>
> ="18 =" & Format((18/(Count(*)-Count([Status]))*100),"#.##") & "%"
>
> What have I missed.
>
> Thanks.
>
>
> On Sun, 4 Sep 2005 07:12:20 -0500, "Duane Hookom"
> <duanehookom@xxxxxxxxxxxxxxxxxx> wrote:
>
>>To count records with a null (no value) in a status field, use
>> Sum(Abs(IsNull([Status]))
>>or
>> Count(*)-Count([Status])
>


.



Relevant Pages


Loading