<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2800.1141" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=360194120-31032003><FONT face=Arial color=#0000ff size=2>True
that sometimes Iif is the tool for the job but:</FONT></SPAN></DIV>
<DIV><SPAN class=360194120-31032003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=360194120-31032003><FONT face=Arial color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=360194120-31032003></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=360194120-31032003>HTH</SPAN>,</FONT></FONT> </DIV>
<P><FONT face=Arial size=2>Jim DeMarco</FONT> <SPAN
class=360194120-31032003><FONT face=Arial color=#0000ff
size=2> </FONT></SPAN></P>
<P><SPAN class=360194120-31032003></SPAN> </P>
<P><SPAN class=360194120-31032003> </SPAN><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
accessd-bounces@databaseadvisors.com
[mailto:accessd-bounces@databaseadvisors.com]<B>On Behalf Of </B>John
Bartow<BR><B>Sent:</B> Monday, March 31, 2003 3:15 PM<BR><B>To:</B>
accessd@databaseadvisors.com<BR><B>Subject:</B> RE: [AccessD] IIf in query discussion<BR><BR></P></FONT>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><SPAN class=450540520-31032003><FONT face=Arial color=#0000ff size=2>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). </FONT></SPAN><SPAN class=450540520-31032003><FONT face=Arial
color=#0000ff size=2>I use it as a guideline not a rule though, the only
"rule" I tend to have is to never rule out anything.</FONT></SPAN></DIV>
<DIV><SPAN class=450540520-31032003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=450540520-31032003><FONT face=Arial color=#0000ff size=2>I
think the biggest drawback beyond speed is that its Access specific and t</FONT></SPAN><SPAN class=450540520-31032003><FONT face=Arial color=#0000ff
size=2>hey can be difficult to read. I think "spreadsheet people" love it
though.</FONT></SPAN></DIV>
<DIV><SPAN class=450540520-31032003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=450540520-31032003><FONT face=Arial color=#0000ff size=2>JB</FONT></SPAN></DIV>
<DIV><SPAN class=450540520-31032003></SPAN><FONT face=Tahoma><FONT
size=2><SPAN class=450540520-31032003><FONT face=Arial
color=#0000ff></FONT></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Tahoma><FONT size=2><SPAN
class=450540520-31032003> </SPAN>-----Original
Message-----<BR><B>From:</B> accessd-bounces@databaseadvisors.com
[mailto:accessd-bounces@databaseadvisors.com]<BR><B>Sent:</B> Monday, March
31, 2003 1:39 PM<BR><B>To:</B> accessd@databaseadvisors.com<BR><B>Subject:</B>
[AccessD] IIf in query discussion<BR><BR></DIV></FONT></FONT>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><FONT face=Arial size=2><SPAN class=866540619-31032003>Recently I read
an article by an Access expert who suggested that using 'iif' in a query is a rookie mistake.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=866540619-31032003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=866540619-31032003>I've made that
mistake.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=866540619-31032003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=866540619-31032003>My
question: Does using 'iif' in a query just slow done processing, or,
does it have more substantial consequences?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=866540619-31032003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=866540619-31032003>TIA,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=866540619-31032003>Myke</SPAN></FONT></DIV>
<DIV><FONT face=Arial
size=2></FONT> </DIV></BLOCKQUOTE></BLOCKQUOTE><CODE><FONT SIZE=3><BR>
<BR>
***********************************************************************************<BR>
"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".<BR>
***********************************************************************************<BR>
</FONT></CODE>
</BODY></HTML>