Using the "RIGHT" function

T

triplettkj

I need to format a column in a query to show only the last four digits
of a social security number. The field is "SSN" and the format is
### ## ####. Is this possible?
 
F

fredg

I need to format a column in a query to show only the last four digits
of a social security number. The field is "SSN" and the format is
### ## ####. Is this possible?

ShowRightSSN:"###-##-" & Right([SSN],4)
 
T

triplettkj

entering this gives me "the expression you entered contains invalid
syntax" error

I need to format a column in a query to show only the last four digits
of a social security number. The field is "SSN" and the format is
### ## ####. Is this possible?

ShowRightSSN:"###-##-" & Right([SSN],4)
 
B

BruceM

Did you put the expression in an empty column? Try this in an empty column
in query design view:

RightSSN: Right([SSN],4)

Fred's suggestion should have worked if it was placed in a new column,
except that it would have showed the literal characters that are enclosed in
quotes. My understanding is that you just want the four digits. You are
creating a query field based on another field, not formatting an existing
field. Once the field is in the query, if you base a form or report on the
query you can select the calculated field just as you would select any other
field as the control source for a text box or whatever.

entering this gives me "the expression you entered contains invalid
syntax" error

I need to format a column in a query to show only the last four digits
of a social security number. The field is "SSN" and the format is
### ## ####. Is this possible?

ShowRightSSN:"###-##-" & Right([SSN],4)
 

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