How to split a field into 2 fields?

G

Guest

I imported a spreadsheet from Excel and would like to split one field into
two fields.

Many of the records in Field1 have a note in parenthesis ( ). If a record
has anything contained in parenthesis, I would like to move that data to
Field2.

What's the best way to accomplish this?
 
G

Guest

To get the word inside the parenthesis try something like

SecondWord:
IIf(InStr([MyLeeter],"("),Mid([MyLeeter],InStr([MyLeeter],"(")+1,Len([MyLeeter])-InStr([MyLeeter],"(")-1),"")

FirstWord:
IIf(InStr([MyLeeter],"("),Left([MyLeeter],InStr([MyLeeter],"(")-1),[MyLeeter])
 
G

Guest

Will this work if there are multiple words?

Often times, the text I have between parenthesis is a phrase (i.e. several
words).



Ofer Cohen said:
To get the word inside the parenthesis try something like

SecondWord:
IIf(InStr([MyLeeter],"("),Mid([MyLeeter],InStr([MyLeeter],"(")+1,Len([MyLeeter])-InStr([MyLeeter],"(")-1),"")

FirstWord:
IIf(InStr([MyLeeter],"("),Left([MyLeeter],InStr([MyLeeter],"(")-1),[MyLeeter])

--
Good Luck
BS"D


Cheese said:
I imported a spreadsheet from Excel and would like to split one field into
two fields.

Many of the records in Field1 have a note in parenthesis ( ). If a record
has anything contained in parenthesis, I would like to move that data to
Field2.

What's the best way to accomplish this?
 
G

Guest

It should work, try it

--
Good Luck
BS"D


Cheese said:
Will this work if there are multiple words?

Often times, the text I have between parenthesis is a phrase (i.e. several
words).



Ofer Cohen said:
To get the word inside the parenthesis try something like

SecondWord:
IIf(InStr([MyLeeter],"("),Mid([MyLeeter],InStr([MyLeeter],"(")+1,Len([MyLeeter])-InStr([MyLeeter],"(")-1),"")

FirstWord:
IIf(InStr([MyLeeter],"("),Left([MyLeeter],InStr([MyLeeter],"(")-1),[MyLeeter])

--
Good Luck
BS"D


Cheese said:
I imported a spreadsheet from Excel and would like to split one field into
two fields.

Many of the records in Field1 have a note in parenthesis ( ). If a record
has anything contained in parenthesis, I would like to move that data to
Field2.

What's the best way to accomplish this?
 
G

Guest

Thank you for the help. That worked.

Ofer Cohen said:
It should work, try it

--
Good Luck
BS"D


Cheese said:
Will this work if there are multiple words?

Often times, the text I have between parenthesis is a phrase (i.e. several
words).



Ofer Cohen said:
To get the word inside the parenthesis try something like

SecondWord:
IIf(InStr([MyLeeter],"("),Mid([MyLeeter],InStr([MyLeeter],"(")+1,Len([MyLeeter])-InStr([MyLeeter],"(")-1),"")

FirstWord:
IIf(InStr([MyLeeter],"("),Left([MyLeeter],InStr([MyLeeter],"(")-1),[MyLeeter])

--
Good Luck
BS"D


:

I imported a spreadsheet from Excel and would like to split one field into
two fields.

Many of the records in Field1 have a note in parenthesis ( ). If a record
has anything contained in parenthesis, I would like to move that data to
Field2.

What's the best way to accomplish this?
 

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