You could create a SQL Server User Defined function to do this as well as Jon's solution.
The UDF approach makes the SQL a little more readable and doesnt perform too bad IMO.
Rodman
Rod Paddock
Editor in Chief CoDe Magazine
President Dash Point Software, Inc.
VP Red Matrix Technologies,Inc.