I need to insert a character.

R

ryan

I have a field that contains nine-digit zip codes "MAIL_ZIP" unfortunately
they are formatted as 123456789 and I need them to be 12345-6789. Is there a
way I can insert a '-' after five digits without replacing the final four?
Thanks in advance.
 
G

Gina Whipp

Ryan,

MAKE A BACK-UP of the table... just in case!

Copy/Past the below in a Query SQL window. Change the names accordingly and
run. Will only add a dash to fields that have 9 characters.

UPDATE YourTable SET YourTable.MAIL_ZIP = Format([MAIL_ZIP],"@@@@@-@@@@")
WHERE (((Len([MAIL_ZIP]))=9));


--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 

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