• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1153
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

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