• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 756
  • Last Modified:

Format Zip Code Field in Report to remove dash if there is only 5 numbers versus 9

How can I format a zip code field in an access report so if the zip code field only has 5 numbers it will print just the five numbers and not have a dash after the 5 numbers.

For example, on my report the zip code is showing as 12345- and I only want it to show 12345.
0
anctech
Asked:
anctech
2 Solutions
 
rockiroadsCommented:
u could try this

REPLACE([zip code],"-","")

put this in your query for the report, instead of just reporting on [zip code]
0
 
BPebCommented:
Or put this in your control source for the field:

=IIF(Len([zip code])>6, [zipcode], Right$([zipcode],5))
0
 
FlysterCommented:
BPeb, shouldn't it be:

=IIF(Len([zip code])>6, [zipcode], Left$([zipcode],5))

Flyster
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
BPebCommented:
Yep, it was the idea that was important! Thanks
0
 
GRayLCommented:
My boss used to tell tell me: "That wasn't an idea - that's just something that won't work!  Don't give me ideas - Give me solutions!"  -  never forget it

Ray

0
 
BPebCommented:
That's great if the boss never wants to know the genisis of an solution.  I've known some like that, but they tend to be the kind that don't want to be bothered by technical details.

Ideas are are the building blocks of solutions.  I'd take a glimpse (clue) of an idea that's fully formed with the assistance of others over having to go figure it out before presenting it.  I think EE is a great place to get ideas to be used dirrectly on a given problem and indirectly on others that might be close.  This process is also called group brainstorming.  Thus I appreciate Flysters correction to the idea.
0
 
anctechAuthor Commented:
I appreciate everyones help with this.  I am thinking that it would be fair to split out the points on this to both BPeb and to Flyster being that I actually used info from both of their postings.  Thank you both for your help.
0
 
FlysterCommented:
Anctec - Thanks for the points. BPeb - Glad to share the idea. :-)
0
 
BPebCommented:
Me too :)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now