473,396 Members | 1,898 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Separate one field into two fields

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
1 4770
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: NotGiven | last post by:
Say you want to display and search "services offered". There are a finite number of services offered. You want to be able to search the database for each service offered separately. Given the...
3
by: Roberto Becerril | last post by:
Hi forum, i'm a little new in javascript and maybe you can help me. I have an html form and an icon, if i click on the icon, a new pop-up window is open and shows a list of numbers with a...
2
by: Phil Matish | last post by:
I would like to know if the following is possible: I have a form and a subform. In the subform, there are records summarized. (For ex, instead of showing all 19 fields, I only show 3 to save...
3
by: EJH | last post by:
I have a Database that has three tables. One of the three is just a table that contains three fields and is filled with reference information. One field is 3-Digit(primary key), the next is...
2
by: blast | last post by:
hi, thanks for heping me in my previous issues....i m really confused reg this issue, please help me: i'm selecting a row from table a for that particular row there are 3 persons (assignee,...
3
by: jayo17 | last post by:
Hi All (Access 2003/XP) I have an Excel file with name information in the form of LastName, First Name in one field. I want to have the name separated into 2 fields, LastName and First...
0
by: Pasquale | last post by:
I have a form with 8 fields, 4 of which are required and 4 are not. Usually if a field isn't required I would create a separate table for it rather than having a blank value in the table where...
1
MindBender77
by: MindBender77 | last post by:
Hello Again All, I have a memo field that is backslash delimited. I am attempting to break up this field into individual fields. Ex (memo field). \John L. Doe\\StreetName RD\\City, Pa 11111 ...
13
by: dizzydangler | last post by:
Just a quick question...I'm running an MS Access 2007 db that tracks appointments in a single table. Date and time are entered as separate fields in short date (mm/dd/yyyy) and short time (hh:mm)...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.