Converting ZIP codes

K

Kirk

Hello,

Small (and dumb I'm sure) question. If I have ZIP code
fields I wanted limited to five digits, how do I replace 9
digit records with just the first 5? Also, if I have
Canadian postal codes (alphanumeric, not just numeric),
how do I prevent those records from being changed?
 
R

RobFMS

It is better if you have the zip code as characters (text), not digits.
Some zip codes have leading zeros which need to be present.

To get the first 5 characters, you can use the LEFT() function.

As for non-U.S. zip codes, I would suggest having some kind of flag that
distinguishes between U.S. and non-U.S. so that you can handle accordingly.

HTH

--
Rob

FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top