Show last four digits of SS#

G

Guest

I'm using the following as the Control in a text box to display only the last
four digits of a social security number in a report:

="xxx-xx-" & Right([SSN],4)

If a SS# exists for a record the report displays xxx-xx-1234. If there is
no social security number, the report displays xxx-xx-

Can the above be modified so that it displays nothing if a social security
number does not exist for a record?

Thanks.
 
G

Guest

I think the syntax is off a little as I received an error message, so I
changed it just a bit. But, I wouldn't have known where to even start
without your help. Thanks!

=IIf(IsNull([SSN]),"","xxx-xx-" & Right([SSN],4))

Al Campagna said:
Katherine,
= IIF(IsNull(SSN), "", "xxx-xx-" & Right(SSN,4)
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Katherine R said:
I'm using the following as the Control in a text box to display only the last
four digits of a social security number in a report:

="xxx-xx-" & Right([SSN],4)

If a SS# exists for a record the report displays xxx-xx-1234. If there is
no social security number, the report displays xxx-xx-

Can the above be modified so that it displays nothing if a social security
number does not exist for a record?

Thanks.
 
A

Al Campagna

Katherine,
Yes, I did drop that last Parens at the end. Doh!
Glad you worked it out...
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Katherine R said:
I think the syntax is off a little as I received an error message, so I
changed it just a bit. But, I wouldn't have known where to even start
without your help. Thanks!

=IIf(IsNull([SSN]),"","xxx-xx-" & Right([SSN],4))

Al Campagna said:
Katherine,
= IIF(IsNull(SSN), "", "xxx-xx-" & Right(SSN,4)
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Katherine R said:
I'm using the following as the Control in a text box to display only the last
four digits of a social security number in a report:

="xxx-xx-" & Right([SSN],4)

If a SS# exists for a record the report displays xxx-xx-1234. If there is
no social security number, the report displays xxx-xx-

Can the above be modified so that it displays nothing if a social security
number does not exist for a record?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top