The 2nd IIF had 3 instead of 2.
NBV122009: IIf(([Cost]<0 And [Accum]<0), ([NBV122008]-[current]*12),
IIf(([Cost]>0 And [Accum]>0), ([NBV122008]-[current]*12),
IIf(([NBV122008]-[current]*12<0),
([NBV122008]-[current]*12),[NBV122008])))
This is how it breaks down ---
NBV122009: IIf(([Cost]<0 And [Accum]<0),
test
([NBV122008]-[current]*12),
true
IIf(([Cost]>0 And [Accum]>0),
false - - test
([NBV122008]-[current]*12),
true
IIf(([NBV122008]-[current]*12<0),
false - - test
([NBV122008]-[current]*12),
true
[NBV122008])))
false
tina said:
will that work, Karl? looks like the third and final IIf() function is
actually a *fourth* argument of the 2nd IIf() function - i didn't see any
documentation of an optional fourth argument in the Help topic.
IIf(([Cost]>0 And [Accum]>0) , ([NBV122008]-[current]*12) , 0 ,
IIf(([NBV122008]-[current]*12<0),
([NBV122008]-[current]*12),[NBV122008]))
hth
KARL DEWEY said:
This should work --
NBV122009: IIf(([Cost]<0 And [Accum]<0), ([NBV122008]-[current]*12),
IIf(([Cost]>0 And [Accum]>0), ([NBV122008]-[current]*12),0,
IIf(([NBV122008]-[current]*12<0), ([NBV122008]-[current]*12),[NBV122008])))
I removed the 'and' from this part --
[Accum]>0),([NBV122008]-[current]*12),0, and
IIf(([NBV122008]-[current]*12<0),([NBV122008]-[
:
CAn anyone please figure out wha't wrong with the query formula
below? Thanks!
NBV122009: IIf(([Cost]<0 And
[Accum]<0),([NBV122008]-[current]*12),IIf(([Cost]>0 And
[Accum]>0),([NBV122008]-[current]*12),0, and
IIf(([NBV122008]-[current]*12<0),([NBV122008]-[current]*12),[NBV122008])))