Zip Codes

garygdj

Registered User.
Local time
Today, 08:12
Joined
May 25, 2006
Messages
19
I have a table that contains a Zip Code field. Some of the Zip Codes are missing the leading 0. Zip Codes are a 5 digit field and these codes only have four. how do I get Access to recognize the number of characters and then add the leading 0 to only the ones that have 4 numbers?

Thanks
 
First off make sure you fields data type is text because a number can't start with a zero. Then in you query use this expression.

IIf(Len([ZipCode])<5,"0" & [ZipCode],[ZipCode])

[zipCode]=name of the ZipCode Field.
 

Users who are viewing this thread

Back
Top Bottom