In a previous post you provided:
TTHOTL:
iif([Ownerspc].[SHOTL],3600-[Ownerspec].[SHOTL],IIf([Ownersch].[SMOHL]<1800,1800-[Ownersch].[SMOHL],3600-[Ownersch].[SMOHL])
I see three different table names:
Ownerspc
Ownerspec <= is this a table name?
Ownersch
I made two tables and a query. I finally got it to return a value by
aliasing the field names.
In the query, where the table name is "Ownersch", I set the field name to
"CH: SMOHL". And for the table name "Ownerspc", I set the field name to
"PC: SMOHL" . (no quotes).
For the column "TTHOTL", I used:
TTHOTL: IIf([PC],3600-[PC],IIf([CH]<1800,1800-[CH],3600-[CH]))
when SHOTL are equal to blank
Might these cases be NULLs? If so, you might try:
TTHOTL: IIf(NZ([PC],0),3600-[PC],IIf([CH]<1800,1800-[CH],3600-[CH]))
or
TTHOTL: IIf(NZ([PC],0)<>0,3600-[PC],IIf([CH]<1800,1800-[CH],3600-[CH]))
HTH
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
NervousFred said:
Steve,
I have tried both ways you have posted. Still have the same issue will all
the false cases coming up with errors but the true case working.
SHOTL is a controled field created with no calculations and the formula
requires the [Ownerspc] and [Ownersch] because I have multiple tables with
[SMOHL] and [SHOTL]
It might be a problem with what you said at the end of your post with IIF
needing a zero. The false cases are when SHOTL are equal to blank("").
Could this be causing the problem and if so is there a way to fix it?