Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format Zip Code - Leading Zero Missing 1

Status
Not open for further replies.

dunkyn

Technical User
Apr 30, 2001
194
0
0
US
Zipcodes with a leading zero have been dropped in my database.

Is there a way to format the field so that 1234 appears as 01234, without adversely affecting zipcodes that do not start with the leading 0?
 
Assuming your zip_code field is numeric, use the following formula:
-------------------------------------
Cstr({zip_code},"00000")
-------------------------------------

Cheers,
- Ido


CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Just what I needed. Thank you!

What does Cstr stand for? I like to understand what I'm doing, other than reformatting a number?
 
Cstr() and ToText() convert stuff to string/text.
Lots of detail on optional arguments (such as the formatting string argument) in Online Help.

Cstr stands for "Convert to String".

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top