Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calculation

Status
Not open for further replies.

TheRiver

IS-IT--Management
Dec 18, 2003
121
GB
wl![WAIT_DUR] = DateDiff(&quot;m&quot;, IIf(wl![U_DNA] <= wl![U_Census_Date], wl![U_DNA], wl![U_DDA]) + wl![U_Days_Susp], wl![U_Census_Date])

Is it possible to add the follwoing to this calculation...

To ignore the U_DNA when it is equal to or less than the U_DDA. If so how do I fit it into the code?
 
Use nested IIF

wl![WAIT_DUR] = DateDiff(&quot;m&quot;, iif(U_DNA <= UDDA,other expression,IIf(wl![U_DNA] <= wl![U_Census_Date], wl![U_DNA], wl![U_DDA])) + wl![U_Days_Susp], wl![U_Census_Date])


Best of luck

 
when you write - other expression what do you mean?
 
TheRiver,

In the case of setting up a nested IIF statement what happens is this.

This is the normal way the statement is set up -

IIF(Expression, True, False)

If I want to nest statements. I then take the false part and create the next IIF statement there. So you'll end up with something like this for example -

IIF(Country=&quot;UK&quot;,&quot;GB&quot;,IIF(Country=&quot;Germany&quot;,&quot;EUR&quot;,&quot;USD&quot;))


HTH,

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top