Link to home
Start Free TrialLog in
Avatar of morinia
moriniaFlag for United States of America

asked on

formatting character zip code to numeric zip code in SQL (SQL SERVER)

I have a zip code coming in as character 9?  Is there a way in the Select SQL statement to change the zip code to numeric 5?
ASKER CERTIFIED SOLUTION
Avatar of didnthaveaname
didnthaveaname

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Surendra Nath
can you provide examples what you are getting what you need?
>I have a zip code coming in as character 9?
Is this a question or a statement?  Mind readers we ain't.

>Is there a way in the Select SQL statement to change the zip code to numeric 5?
If you mean just insert the first five characters, and drop off the rest, then

SELECT LEFT(zip_code, 5)

If you mean something else, you'll need to give us details / sample data.