Left ( Yourtextfield ; Position ( YourTextField ; "-" ; 1 ; 1 ) - 1 )
This will return all text to the left of the first hyphen found in your text field. If there is no hyphen in the field, no text will be returned, though a more sophisticated version of the above could be created to return the entire contents of the field in those cases if desired.
GetValue ( Substitute ( textField ; "-" ; ¶ ) ; 1 )
This will work too:
LeftWords ( Substitute ( TextField ; "-" ; " " ) ; 1 )
Not if you have: Word 1 Word 2 - Word 3 ;-)
I like LaRetta's method better than mine as it returns the entire text if the hyphen is omitted.
> Not if you have: Word 1 Word 2 - Word 3
Yes, I know, but I got the impression from the original post that the data was in a kind of "serial number" format of XXXX-XXXX. As you know, without all of the pertinent facts, one has to make educated guesses a lot of the time about what someone is doing or trying to do ;-)