Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / February 2006

Tip: Looking for answers? Try searching our database.

Separate one field into two fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tony - 17 Feb 2006 17:08 GMT
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
fredg - 17 Feb 2006 17:31 GMT
> Hi,
>
[quoted text clipped - 8 lines]
>
> 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.

Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.