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

Using IIF with calculated time fields

Status
Not open for further replies.

jabrony76

Technical User
Apr 23, 2001
125
US
Hello,
I am creating an access 97 db to track a time difference and I recently started to work on the complaince query. Now I would like to use the IIF function (or any other function that will work) to show if the time difference is complaint with standards or non-complaint. Heres how I set it up.
Table with referral given and first contact fields, then a simple "Turn Around Time" field being
[first contact]-[referral given] with the field properties format being hh:\nn.
All is good until then... the next field in the query I am entering
IIF ([Turn Around Time] < 2, &quot;Compliant&quot;, &quot;Noncomplaint&quot;)
to disseminate whether we are within the 2 hour complaince

Herein lies the problem, that field is telling me that all the records are complaint, even the dummy records that I entered to be way over 2 hours. I'm assuming its a problem with the <2 part of the formula??? Please Help!
Thanks,
Andy
 
Forgett he format for the field, it ONLY affects the display.

IIF(DateDiff(&quot;nn&quot;, first contact], [referral given]) \60, < 2, < 2, &quot;Compliant&quot;, &quot;Noncomplaint&quot;)

MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
when you substract two dates, the result is shown in days. You will have &quot;Noncomplaint&quot; only for 2 days and older.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top