>I thought about it too, but we have a warning in the Help to SQL that it's better not to use UDF in SQL, if it can be avoided. Do you have some info, which you can share, what is the best in such situations: use UDF or very nested IIF?
I am sure the nested IIFs would be faster. But I think that quite often, it doesn't matter in actual practice, so I would prefer the UDF for readibility.
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)