Substituting Data in a column

J

JLR

I have a column named Group_2 which represents a bunch of names with data I
don't need.

For instance, some of the data comes over in the tables as
Ashburn(1456)
Westfield(12346)
Joe Smith(21324)

I am trying to do 2 things here...
1. Remove the numerics and paranthesis completely
2. Substitute the name Joe Smith with Jane Doe (for example)

How do I write an expression to do this and do I have to do this in an
additional table, or can I do it in a query?
 
M

M.

You could use the VBA function InStr to find the first position of a
character in a string, e.g. to find "(". Remember to substract -1 to exclude
the character itself
You could then use the VBA function Left to extract only the first part of
your string

Left([YourField],(Instr(1,[YourField],"("-1))

For the name switch, read the documentation of the IIF function

Regards,

M.
 

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