Try this:

IIF([Trouser 1] is null, 1, 0)

Tracy


> -----Original Message-----
> From: Stephen Russell
> Sent: Thursday, September 28, 2006 9:02 PM
>
> I'm finding some reporting work in Access and it's driving me
> up the wall. It's a flat flie table, and it sucks.
>
>
> iif(isNull([Trouser 1]) ,0,1)+iif(isNull([Trouser 1])
> ,0,2)+iif(isNull([Trouser 3]) ,0,1)+iif(isNull([Trouser 4])
> ,0,1) as Trtotal4,
>
> If I have a null, most cases, it will count as a 1, instead of a 0.
>
> Any ideas?
>
> Tried all of this code so far:
> IIf([Shirt 1]="    ",0,1)+IIf([Shirt 2]="   ",0,1)+IIf([Shirt 3]="
> ",0,1)+IIf([Shirt 4]="   ",0,1) AS ShirtTotal,
>
> IIf(IsEmpty([Shirt 1]),0,1)+IIf(isEmpty([Shirt
> 2]),0,1)+IIf(isEmpty([Shirt 3]),0,1)+IIf(isEmpty([Shirt
> 4]),0,1) AS ShirtTotal2,
> iif(isNull([Shirt 1]) ,0,1) as Shirttotal3,
> iif(isNull([Trouser 1]) ,0,1)+iif(isNull([Trouser 1])
> ,0,2)+iif(isNull([Trouser 3]) ,0,1)+iif(isNull([Trouser 4])
> ,0,1) as Trtotal4, IIf(len(trim([Shirt 1]))=0,0,1) as sh1,
> IIf(len(trim([Trouser 1]))=0,0,1) as tr1,
> IIf([Shirt 1]<="   ",0,1) as sh2,
> IIf([Trouser 1]<="   ",0,1) as tr2,
>
> len(trim([Shirt 1])) as sh01,
> len(trim([Trouser 1])) as tr01,
>
>   IIf([Shirt 1]=" ",0,1)+IIf([Shirt 2]
> =" ",0,1)+IIf([Shirt 3]="",0,1)+IIf([Shirt 4]=" ",0,1) AS
> ShirtTotal_1,
>    IIf([Trouser 1]=" ",0,1)+IIf([Trouser 2]
> ="",0,1)+IIf([Trouser 3]=" ",0,1)+IIf([Trouser 4]=" ",0,1) AS
> ShirtTotal_2,
>
>
> None provide the proper 0 or 1,2,3,4 for both all nulls or
> for giving the proper count.
>
> Any ideas?
>
> TIA
>
> Stephen Russell
> DBA / .Net Developer




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to