Postal code format in mail labels

J

John Michael

I'm trying to print mail labels with a report I have created.
How can I get the postal code to print in this format
#####-####
with the hyphen after the first 5 numbers.

Here is the line in the label.
=Trim([City] & ", " & [StateOrProvince] & " " & [PostalCode])

I have set the format property for that field in both the tables and the
query to:
00000"-9999";;_
and it does not work. they still come out like: ######### without the
hyphen.


Thanks
John Michael
 
F

fredg

I'm trying to print mail labels with a report I have created.
How can I get the postal code to print in this format
#####-####
with the hyphen after the first 5 numbers.

Here is the line in the label.
=Trim([City] & ", " & [StateOrProvince] & " " & [PostalCode])

I have set the format property for that field in both the tables and the
query to:
00000"-9999";;_
and it does not work. they still come out like: ######### without the
hyphen.

Thanks
John Michael

=Trim([City] & ", " & [StateOrProvince] & " " & IIf(Len([PostalCode])
5,Left([PostalCode],5) & "-" & Right([PostalCode],4),[PostalCode])

The above should work whether the PostalCode is 5 or 9 digits.
 

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