Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zip+4 in an update query

Status
Not open for further replies.
Jun 11, 2008
34
US
I import an access table that formats the zipcode as follows: For 23225-0522. It reads 232250522. In an update query, how can I format the zip code so that if it is 9 digit, it will read 23225-0522? If it is a 5 digit zip I need it to read 23225 with no dash at the end.
 
Code:
UPDATE ZipTable 

SET [ZIP] = Left([ZIP],5) & "-" & Right([ZIP],4)

WHERE Len([ZIP]) = 9
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top