Move the last data in a new field

D

Dimitris

Hello in a field of a table there is data entered and at the end of most
entries there is a bracket with some letters inside. (AB)
What I need is to remove the brackets and the letters included into a new
field. So if the data in the field is "John Smith (GM)" I want John Smith to
remain in the field but (GM) to move to the new field.
Note that some entries do not have brackets at all, but the ones that do
have them, are always at the end if that makes any difference.

Can someone help?
Thanks
Dimitris
 
A

Allen Browne

Use Instr() to locate the brackets, and Mid() to pick up the rest of the
field.

Use an update query (Update on Query menu in query design) to update your
other field.
 
D

Dimitris

Thanks for your reply, but I don't understand what to do.
I have limited knowledge in Access.
Can you please tell me what exacly I should do.
 
D

Duane Hookom

How about providing some real names of "a field" "a table" "a new field"?
Is the "a new field" empty?

Have you ever used an update query?
 
D

Dimitris

Table name is: ICP1 field name is: THESI new field is: PST
The New Field PST is empty.
I have used a new field before when some people helped me. But I don't know
what Instr() is and what to write in the Mid()
Sorry but I am new in access.

Dimitris
 
D

Duane Hookom

Make a backup copy of your table and try:

UPDATE ICP1
SET THESI = Trim(Left(THESI, Instr(THESI,"(")-1))),
PST = Trim(Mid(THESI, Instr(THESI,"("))))
WHERE THESI Like "*)"
 
D

Dimitris

Thank You

Duane Hookom said:
Make a backup copy of your table and try:

UPDATE ICP1
SET THESI = Trim(Left(THESI, Instr(THESI,"(")-1))),
PST = Trim(Mid(THESI, Instr(THESI,"("))))
WHERE THESI Like "*)"
 

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