Reputation: 842
Fellow overflowers,
I am working with a database to sort several other databases and change some values so my scada application can use the values in the database.
Now I have encountered the following problem:
I have a column called "Name" and in this column are string values like this one:
S1\SVS_AK\STS\Status[7]
From this string I'd like to cut (or copy, doesn't really make a difference eitherway) the "[7]" part and paste this behind whatever I have in a different column.
So for example:
I have a column "Address" and a column "Name" I want to take the [7] from the Name Column and paste that behind the already existing string "DB32,7.3" wich exists in the column Address
How can I possibly do this? Preferably with a query
Thanks in advance!
Upvotes: 1
Views: 1549
Reputation: 91316
How about:
UPDATE ATable SET AField2 = Mid(AField,instr(AField,"[")) & AField2
You might like to add
WHERE AField Like "*[[]*"
[ is a special character, so it need to be bracketed for the Like statement, as illustrated.
Upvotes: 2