Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Appending 0 if length < 2

$
0
0

Hi,

I am doing some manipulation on the string such that if i was given 2 characters, I will prefix it with "0". If it's 2 characters, no manipulation is done.

Currently I am doing RIGHT("0" + rtrim(char1), 2).

Is this the best way to do this?


cherriesh


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>