>>I often replace IF with IIF. I don't think the time difference will be >significant, but I do suggest, as a general norm, to reduce redundant code. >I am fairly sure the compiler will not optimize this.
>
>Every ns counts! :) Granted it would take E9 redundant iif's in my example to be a second...
Program readability counts, too. You must decide whether it is worth the trouble to code around this.
OTOH, the redundant assignment may be partly offset (?) or more than offset (?) by the fact that IIF() is faster than IF.
Speed tests are warranted, but I will leave for you, as "homework".
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)