Split a field

gselliott

Registered User.
Local time
Today, 22:58
Joined
May 17, 2002
Messages
106
I am setting up a report and I want to be able to remove everything in the field before the - symbol. For example the field shows the business unit and section:

Business Unit - Section

All I want to do is remove the business unit (everything before the -). Would I be able to use Trim? If so can anyone give me some idea how this can be done would it be better to do this in the query?


Thanks
 
NewField: Left([MyField], InStr(1, [MyField], "-") - 2)
 
Thanks for that it works but leaves me with the wrong data I want to be left with everything after the -

Sorry I probably didn't make myself clear if the field says Construction - East all I want to be left with is "East" at the minute I am being left with "Construction", it is probably really simple but just not sure how to change it.
 
Sorry, didn't read it right:

NewField: Right([MyField], Len([MyField) -InStr(1, [MyField], "-") + 2)
 
Brilliant works a treat thanks again for your help it is much appreciated!
 

Users who are viewing this thread

Back
Top Bottom