Splitting a string at a space or hyphen

J

JoeA2006

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)
 
Top