View Single Post

   
  #1 (permalink)  
Old 02-29-2008, 07:28 PM
hharry
 
Posts: n/a
Default converting integer zipcodes to a 5 character char

hello all,

is there a quick way to convert a zipcode of type int, to a 5 character
char value ?
e.g.

declare @zip int
declare @czip char(5)
select @zip = 2109
select @czip = convert(char, @zip)
select @czip

but with @czip = 02109 instead of 2109 ?


thanks in advance

Reply With Quote