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

How do I add leading zeros for social security field?

I have output that appears as such:

999999999
99999999

How can I get the second row to dispay leading zeros based on a 9 character rule specific to social security number output?

I would like Crystal to display for the second row:
099999999
0
jmorin1
Asked:
jmorin1
1 Solution
 
peter57rCommented:
Hi jmorin1,
You can use a formula field:

Cstr({table.Field},"000000000")

Pete
0
 
jmorin1Author Commented:
Excellent!  It worked to perfection.  

Can I get a two for one steal? What would I do to insert dashes?
0
 
bdreed35Commented:
Use the Picture function to add the hyphens:

picture(Cstr({table.Field},"000000000"),"xxx-xx-xxxx")
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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