Try it this way.
Areasq: IIf(Abs(IsNull([ODLength])+IsNull([ODWidth])+IsNull([ODHeight]))IN
(2,3),Nz([ODLength],1)*Nz([ODWidth],1)*Nz([ODHeight],1),Null)
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
[email protected] wrote:
I've been fiddling with this:
Areasq: IIf(IsNull([ODLength])+IsNull([ODWidth])
+IsNull([ODHeight])>=0,Null,IIf(IsNull([ODLength])+IsNull([ODWidth])
+IsNull([ODHeight])<1,Nz([ODLength],1)*Nz([ODWidth],1)*Nz([ODHeight],
1),Null))
Obviously, I still have the problem of "1" being returned when all are
Null. Is there any way I can work that out? I threw in the first IIf
to return Null if two fields are Null and it seems to work.
Thanks for you continued help!
IF you mean the value is Null then you can use the formula below.
NZ(IDL,1) * NZ(IDW,1) * Nz(IDH,1)
There are two potential problems with this. If all the values arenull, the
formula will return 1. If two values are null, the formula will return the
value in the non-null field.
If that is a problem then test to see if more than one is null
IIF(IsNull(IDL)+IsNull(IDW)+IsNull(IDH)<-1,NZ(IDL,1)*NZ(IDW,1)*Nz(IDH,1),Null)
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
[email protected] wrote:
Three fields:
IDL
IDW
IDH
When each field has data then they're calculated to arrive at a cubic
value. The trick is to calculate an area value when only two fields
have data.
The possible combinations are:
IDLxIDW
IDLxIDH
IDWxIDH
Does anyone have a simple approach to this? I can write the code but
with my skills it will most likely be ridiculously long and
inefficient.
Thanks for any help you might have!- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -- Hide quoted text -