Link to home
Start Free TrialLog in
Avatar of anctech
anctech

asked on

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.
Avatar of rockiroads
rockiroads
Flag of United States of America image

u could try this

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

put this in your query for the report, instead of just reporting on [zip code]
SOLUTION
Avatar of BPeb
BPeb
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yep, it was the idea that was important! Thanks
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

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.
Avatar of anctech
anctech

ASKER

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.
Anctec - Thanks for the points. BPeb - Glad to share the idea. :-)
Me too :)