Splitting a string at a space or hyphen

G

Guest

I am using the following expression in query builder to create a new column
showing a substring of everything to the right of the last space in the
description.

Mid([Describe],(InStrRev([Describe]," "))+1)

This works fine, until I discovered some of the descriptions might contain
either a space OR a hypen. Is there anyway to use this expression with
either a hyphen or a space.
 
A

Allen Browne

Use Replace(), e.g.:

Mid([Describe],(InStrRev(Replace([Describe], "-", " ")," "))+1)
 

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