By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,491 Members | 1,868 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,491 IT Pros & Developers. It's quick & easy.

Separate one field into two fields

P: n/a
Hi,

I have an ID text field that is composed of two alphabetical letters
and the rest are numbers. This field is also a primary key. In this
same table, I want to separate this field into two fields. Then make
these two new fields primary keys. The first just contains the two
alphabetical letters. The second contains the numerical digits. Is
there a way to do this without losing current data?

Thanks,

Tony

Feb 17 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 17 Feb 2006 09:08:07 -0800, Tony wrote:
Hi,

I have an ID text field that is composed of two alphabetical letters
and the rest are numbers. This field is also a primary key. In this
same table, I want to separate this field into two fields. Then make
these two new fields primary keys. The first just contains the two
alphabetical letters. The second contains the numerical digits. Is
there a way to do this without losing current data?

Thanks,

Tony


Add 2 new fields to your table, [LetterPortion] and [NumberPortion] as
Text datatypes.

You can run an update query after you added the two new fields to the
table.

Update YourTable Set YourTable.LetterPortion = Left([TextField]),2),
YourTable.NumberPortion = Mid([TextField],3);

Change the field names however you want.

Both the letter and number portions are still Text datatype and you
still have your original ID field.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Feb 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.