Insert a Dash into a Zip Code

  • Thread starter Thread starter David
  • Start date Start date
D

David

How would you write a query to insert a dash after the 5th
number into a 9 digit zip code? ie xxxxxxxxx to xxxxx-
xxxx?
Some of the records have 5 numbers and some have 9.
This needs to be done at the table level, not the report
level.
 
Some of the records have 5 numbers and some have 9.

Well, that's new information and you will need to test for the length of the
data in your ZipCode field, using the following in the UpDate to row:

Iif(Len(Trim([ZipCode]))=5, [ZipCode], Format([ZipCode],"00000-0000"))
 
Back
Top