• Grasshopper, both your posted SQL statements result in invalid length passed to substring errors when I attempted to execute the statements on SQL Server 2008R2 RTM.

    - -

    HTH -- Mark D Powell --