[AccessD] IIf in query discussion

Jim DeMarco Jdemarco at hshhp.org
Mon Mar 31 14:46:51 CST 2003


True that sometimes Iif is the tool for the job but:
 
IIf is also available in VB/VBA so it's not necessarily Access specific.  I attended a Ken Getz demo last year and he showed some performance analyses one of which was a comparison of IIf vs. If...End If used in functions in standard code modules.   The If...End If  was 50-70% faster than IIf depending on the conditions being evaluated.  Don't forget that an Iif statement evaluates all conditions which can also degrade performance.
 
HTH, 

Jim DeMarco  

 

 -----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of John Bartow
Sent: Monday, March 31, 2003 3:15 PM
To: accessd at databaseadvisors.com
Subject: RE: [AccessD] IIf in query discussion



You probably need to give us more details but I tend to agree in philosophy with the idea that IIF should not be used unless necessary. But in practice it is sometimes necessary. I have it used it mostly when querying a pre-existing database which is poorly normalized (hmmm, that might be an oxy-moron). I use it as a guideline not a rule though, the only "rule" I tend to have is to never rule out anything.
 
I think the biggest drawback beyond speed is that its Access specific and they can be difficult to read. I think "spreadsheet people" love it though.
 
JB
 
 -----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]
Sent: Monday, March 31, 2003 1:39 PM
To: accessd at databaseadvisors.com
Subject: [AccessD] IIf in query discussion



Recently I read an article by an Access expert who suggested that using 'iif' in a query is a rookie mistake.
 
I've made that mistake.
 
My question: Does using 'iif' in a query just slow done processing, or, does it have more substantial consequences?
 
TIA,
Myke
 



***********************************************************************************
"This electronic message is intended to be for the use only of the named recipient, and may contain information from HealthSource/Hudson Health Plan (HS/HHP) that is confidential or privileged.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this message is strictly prohibited.  If you have received this message in error or are not the named recipient, please notify us immediately, either by contacting the sender at the electronic mail address noted above or calling HS/HHP at (914) 631-1611. If you are not the intended recipient, please do not forward this email to anyone, and delete and destroy all copies of this message.  Thank You".
***********************************************************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030331/96b9a32a/attachment-0001.html>


More information about the AccessD mailing list