Hi,
Is there a way to hide the SSN number in the report and just show them last 4 digits only.
SSN number should be in this format XXX-XX-1234
Thanks for all the help in proving solutions to resolve this issue for me.
Thanks,
Raju
You can use the substring function for this. The syntax will depend on what is the field type in the database table.
Ex: If the field is character with a format/mask of xxx-xx-xxxx then
'xxx-xx-' + substring(SSN,6.4)
There is another post in this forum for security on SSN Nos. Check that one too.
The field type is the numeric. I want to display both fields one with SSN number and another one with last 4 digits only.
I tired your solution but it is giving me error message when i test the sample.
You can't perform a string function on a numeric value. Try casting it to a string first. There are few different ways to do this depending on your DBMS. I believe something similar to below should work.
'xxx-xx-' + substring(cast([SSN],VARCHAR(9)),6.4)
rajua99 - There will be a comma between 6 and 4. I made a typo to make your life difficult ! ;)
Quote from: Lynn on 02 Feb 2011 03:01:29 PM
You can't perform a string function on a numeric value. Try casting it to a string first. There are few different ways to do this depending on your DBMS. I believe something similar to below should work.
'xxx-xx-' + substring(cast([SSN],VARCHAR(9)),6.4)
This solution worked for me. Thanks a lot to Lynn and Cognostechie.