Using the "RIGHT" function

  • Thread starter Thread starter triplettkj
  • Start date Start date
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?
 
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)
 
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)
 
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)
 
Back
Top