how to extract the characters up to the first ( mark
Mid([YourFieldName], InStr([YourFieldName], "(")+1)
Open in new window
myText = Split(yourFieldname, "(")(0)
The split function returns an array, which you can declare and assign the return value of split to it, something like:
Dim myArray() as string
myArray = Split("now is the time for all good men", " ")
This would return an 8 element array starting at 0 and ending at 7 with each of the individual words.
But it's handy for your situation because if it doesn't find the left paren, it will just return the entire string as the first element (0).
good catch, Daniel. Yes, i miss that "in a query" comment in the original post.
IT issues often require a personalized solution. With Ask the Experts™, submit your questions to our certified professionals and receive unlimited, customized solutions that work for you.