How do I extract the last 4 digits of SSN?

J

Jrod

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.
 
R

Rick B

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.
 
R

Rick B

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.
 
J

Jrod

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.
 
R

Rick B

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.
 

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