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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using IIF

Status
Not open for further replies.
May 5, 2000
168
US
I have an expression as follows: =IIf([PropArcLbr00]&lt;[TotArcLbr00],&quot;Close this phase&quot;,&quot;&quot;)<br><br>Can I use &lt; or =?&nbsp;&nbsp;Can't get it to work
 
I guess you are getting a Error?<br>Where are you using the IIF?<br>In a report or what.<br>The Data type of the textbox you are putting this in has to be a TEXT type because the result of the IIF is Text i.e.<br>&quot;Close this phase&quot;,&quot;&quot;) <br>If its a numeric like Single or Integer then the Error is saying I want a number not Text.<br><br>OK<br><br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
It is on a form.&nbsp;&nbsp;It works fine if I use the &lt; or the = individually.&nbsp;&nbsp;It's when I use them together that I get no response.
 
well if you're trying to get the equivalent of <br>[PropArcLbr00]&lt;=[TotArcLbr00]<br><br>couldn't you just use:<br>[TotArcLbr00]&gt;[PropArcLbr00]<br><br>same algebraic equivalent. <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
Brian, take another look at that... at least in the algebra I was taught, <b>x &lt;= y</b> is equal to <b>y &gt;= x</b>.
 
VB language requires you to repeat the subject, in otherwords you have to say something like this<br>: =IIf([PropArcLbr00]&lt;[TotArcLbr00] or [PropArcLbr00]=[TotArcLbr00] ,&quot;Close this phase&quot;,&quot;&quot;)<br><br>You might want to give it a try...<br>
 
sorry, elizabeth you're right, i was thinking in the negative - x not being &lt;=<br><br>so much for intelligent thought in the morning.<br><br>mkervin's IIf should work. <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
Uh-uh. The problem is someplace other than the &quot;&lt;=&quot;. Perhaps a formatting inconsistancy?<br><br>In a text field, in a form bound to an underlying table with fields that are Long Integers, this works correctly for me:<br><br>=IIf([firstvalue]&lt;=[secondvalue],&quot;first value is smaller or equal&quot;,&quot;&quot;)
 
Brian, if you find that there is <i>any<i> time of the day you're consistantly intellegent, you're ahead of me!&nbsp;&nbsp;:)&nbsp;&nbsp;I relish each moment of lucidity. <br><br>janerussel, if for some reason the &quot;&gt;=&quot; doesn't work in your app, and your values are integers, maybe you could try [TotArcLbr00]&gt;([PropArcLbr00]+1)?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top