using Update Query to search and replace a specific character/stri

G

Guest

I have a table with multiple columns of data. Rather than manually using the
"Replace" option with the "Edit" menu to search for data containing the
character "(" and ")" and replacing it with "[" and "]", I would like to see
if I can use the Update Query to accomplish this task.

I tried many times, and the closest I've gotten is replacing all my data
containing "(" with simply "[", with the main information being replaced as
well.

Can anyone provide suggestions? Thank you.
 
G

Guest

Create a query based on the table and place all the fields that have the
brackets to be replaced into the query.
Change the query type to an update query and then in the update to row of
every column put the folowing ([FieldName] is the actual field name in your
table relevant to each column)

Replace([FieldName],"(","[")

Run the query and all the data will be updated.
Change each Replace statement to this

Replace([FieldName],")","]")

Run the query again and all your data in the table will be have been changed
from
(SomeData) to [SomeData]
 
W

Wolfgang Kais

Bingo.

Bingo said:
I have a table with multiple columns of data.
Rather than manually using the "Replace" option with the "Edit"
menu to search for data containing the character "(" and ")" and
replacing it with "[" and "]", I would like to see if I can use the
Update Query to accomplish this task.
I tried many times, and the closest I've gotten is replacing all
my data containing "(" with simply "[", with the main information
being replaced as well.

So you typed "[" ind the "update" field. Try this instead (Acc2k+):
=Replace(Replace([YourField],"(","["),")","]")
 

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