Peeps,
I have had several occasions to take a simple integer and convert it to a varchar that has two leading zeros. Is there an easy way to code this? Perferably a little more advanced so that if the integer only needs one or two leading zeros the code can help
Current bodge:
select
'PLAYER' + '00' + PlayerNumber as PlayerName
From PlayerDetails
Alwas should deliver
PLAYERnnn (where n is the PlayerNumber between 001 and 009)
So expecting PlayerNumber to be between 1 and 9. While this is ok it does not cope if that playerNumber exceeds 9
Is there a real easy simple way to do this?
Cheers
Ells