Re: query



On Wed, 25 Oct 2006 22:30:01 -0700, Tiffany wrote:

Thank you very much. What if in the column, there is also alphabets like
abc
rde
fgd
123
256

and I just want 00+ to apply to numbers only. What should I do? Kindly advise.

Hi Tiffany,

Use a CASE expression:

SELECT CASE
WHEN ColumnNameHere NOT LIKE '%[^0-9]%'
THEN '00' ELSE '' END + ColumnNameHere
FROM TableNameHere;

--
Hugo Kornelis, SQL Server MVP
.