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

Want to break a column text in two column

P: 2
Dear friends,
I have a problem.I want to break a column in which Address text is written, into two other column for Ist adrress and 2nd City.How Can i do this.
Thanks
Dec 11 '06 #1
Share this Question
Share on Google+
5 Replies


NeoPa
Expert Mod 15k+
P: 31,661
Dear friends,
I have a problem.I want to break a column in which Address text is written, into two other column for Ist adrress and 2nd City.How Can i do this.
Thanks
What you need to do first is give a little more information.
We need your current table or query and the manner of splitting you require (Is it on each comma (,) etc).

Please post the MetaData (Name of table and Fields + Type of Fields) for tables and/or the SQL for queries.
Dec 11 '06 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
Dear friends,
I have a problem.I want to break a column in which Address text is written, into two other column for Ist adrress and 2nd City.How Can i do this.
Thanks
If the column has a comma separating the two values then it's not too difficult.
You need to run the following query.

Expand|Select|Wrap|Line Numbers
  1. UPDATE TableName SET [1st address]=Left([Address], InStr([Address], ",")-1), [2nd City]=Right([Address], InStr([Address], ",")+2)
  2.  
Mary
Dec 11 '06 #3

P: 2
Hi
I want to say that there is no comma in the text, text are seperated by space only. once again i told u---suppose it is the text in the column
C-43 Teacher Colony Deoband
i want to break the above example so that the first part C-43 should be in one column and Teacher Colony in 2nd column and Deoband should be in third column.
Plz help me.
Dec 12 '06 #4

NeoPa
Expert Mod 15k+
P: 31,661
I cannot help much here as the MetaData is still unavailable.
However, I guess that you're talking about imorting text into the database rather than processing records already imported.
If you go through the Import Wizard (File / Get External Data / Import...) then there is an option to import as delimited.
Use this and set the delimiter to space.
Dec 12 '06 #5

MMcCarthy
Expert Mod 10K+
P: 14,534
I cannot help much here as the MetaData is still unavailable.
However, I guess that you're talking about imorting text into the database rather than processing records already imported.
If you go through the Import Wizard (File / Get External Data / Import...) then there is an option to import as delimited.
Use this and set the delimiter to space.
Also if the text file is set to fixed size fields you can import it as a fixed length text file.

Mary
Dec 12 '06 #6

Post your reply

Sign in to post your reply or Sign up for a free account.