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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with a formula 1

Status
Not open for further replies.

cyreports

Programmer
May 12, 2010
89
0
0
US
Per my clients request, they need to only report the last 4 digits of the patients SSN. In SQL I formatted it to already do the dashes between. I could change the SQL, however this SP is shared with some other reports and its only on this one form they need the SSN formatted this way, so I think the Crystal Formula would make it easier on me. Here is how its formatted in SQL:

'52.PatientSSN' = ISNULL(SUBSTRING(pp.SSN , 1 , 3) + '-' + SUBSTRING(pp.SSN , 4 , 2) + '-' + SUBSTRING(pp.SSN , 6 , 4) , ''),

Can someone assist me with a Crystal Formula to get the last 4 to show and the first 5 to show as 5 'X''s. Example - XXX-XX-3356
 
Use Replace() function

@patient

Replace({yourfield},"-", "")

This will convert

XXX-XX-3356 into XXXXX3356

Ian
 
I apologize for not stating my issue correctly. Right now, due to the SQL my SSN would populate as such:

455-55-1234

What I need it to look like is:

XXX-XX-1234

I am getting the numbers now for the First 5.
 
Ian,

Thank you so much for the hand. I really appreciate you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top