How do I extract the last 4 digits of SSN?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two tables. I need to extract the last 4 digits of the SSN from table
A to a new column in table B. I have tried Right([SSNFieldName], 4) but could
not get it to work. Any suggestions would be appreciated.
 
What do you mean you could not get it to work? That is how you'd do it.

A better question is why are you storing a portion of the field twice? Just
pull the four digits when you need them using a query, report, or form.
Storing the data twice in two places is not good database design.
 
Is your field a text or number field? I don't think "right" will work with
a number. You'd have to convert it to string, then pull the right four
digits.

--
Rick B



Rick B said:
What do you mean you could not get it to work? That is how you'd do it.

A better question is why are you storing a portion of the field twice? Just
pull the four digits when you need them using a query, report, or form.
Storing the data twice in two places is not good database design.

--
Rick B



Jrod said:
I have two tables. I need to extract the last 4 digits of the SSN from table
A to a new column in table B. I have tried Right([SSNFieldName], 4) but could
not get it to work. Any suggestions would be appreciated.
 
It is a text. I got them extracted, now I am trying to get an update to work.

Rick B said:
Is your field a text or number field? I don't think "right" will work with
a number. You'd have to convert it to string, then pull the right four
digits.

--
Rick B



Rick B said:
What do you mean you could not get it to work? That is how you'd do it.

A better question is why are you storing a portion of the field twice? Just
pull the four digits when you need them using a query, report, or form.
Storing the data twice in two places is not good database design.

--
Rick B



Jrod said:
I have two tables. I need to extract the last 4 digits of the SSN from table
A to a new column in table B. I have tried Right([SSNFieldName], 4) but could
not get it to work. Any suggestions would be appreciated.
 
Again, why would you update the other table? That is redundant. When you
need to pull the last four, just use a calcualted control in your forms,
reports, or queries.

--
Rick B



Jrod said:
It is a text. I got them extracted, now I am trying to get an update to work.

Rick B said:
Is your field a text or number field? I don't think "right" will work with
a number. You'd have to convert it to string, then pull the right four
digits.

--
Rick B



Rick B said:
What do you mean you could not get it to work? That is how you'd do it.

A better question is why are you storing a portion of the field twice? Just
pull the four digits when you need them using a query, report, or form.
Storing the data twice in two places is not good database design.

--
Rick B



I have two tables. I need to extract the last 4 digits of the SSN from
table
A to a new column in table B. I have tried Right([SSNFieldName], 4) but
could
not get it to work. Any suggestions would be appreciated.
 
Back
Top