Hi All,
How would I do the following in SQL...
My database column has values such as the below
FA-8a0
FA-9a0
FA-10a0
so the format is 2 digit of text then hypen then number then lowercase letter then number
I want to in basic SQL (using substring etc) ensure that where the first number is less then 10 (i.e. 1 to 9) that I
can add a leading zero to it (so the number part is always 2 digits), so it would then convert FA-8a0 to FA-08a0
and FA-9a0 to FA-09a0
FA-10a0 would remain unchanged as the number 10 is 2 digits..
The DB Im using is MS SQL Server 2005.
Any help would be great.
Thanks, Ronan.
How would I do the following in SQL...
My database column has values such as the below
FA-8a0
FA-9a0
FA-10a0
so the format is 2 digit of text then hypen then number then lowercase letter then number
I want to in basic SQL (using substring etc) ensure that where the first number is less then 10 (i.e. 1 to 9) that I
can add a leading zero to it (so the number part is always 2 digits), so it would then convert FA-8a0 to FA-08a0
and FA-9a0 to FA-09a0
FA-10a0 would remain unchanged as the number 10 is 2 digits..
The DB Im using is MS SQL Server 2005.
Any help would be great.
Thanks, Ronan.