>Using macro substitution inside a query is a bad idea anyway because it forces SQL to evaluate the macro for every row, and slows the query dramatically. HTH
Erik, are you sure about this? If yes, then try some quick test.
Actually, this is UDF which might be evaluated for each row.
Edward Pikman
Independent Consultant