You are here: Int to char conversion « MsSQL Server « IT news, forums, messages
Int to char conversion

Posted by jim_geissman on 02/02/06 20:04

I have data tables that include ZIP code, as char(5). The values look
like integers, but they are padded with leading zeroes to fill out 5
characters, '00234'.

There are SPs to look up data, with @Zip char(5) among the parameters.
Some users call these with integer values, @Zip = 234, and SQL makes
the conversion. Is it necesary to add the leading zeroes in the SP --
@Zip=RIGHT('00000'+@Zip,5) -- or would SQL find this match? (234 =
'00234'). It looks like the conversion is to '234' and the match
fails.

Thanks,
Jim Geissman
Countrywide

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация