Remove Character String

scgoodman

scgoodman
Local time
Today, 17:54
Joined
Jun 6, 2008
Messages
87
I am trying to remove characters. For example, I am trying to only retreive the record before the (). Can anyone help?
16061279455(HKHKG-USATL)
 
How about:

Left([YourFieldName],Instr(1,[YourFieldName],"(")-1)
 
Thanks

Thanks, that worked!
 
GladWeCouldHelp.png
 
When I use this...I get a data type mismatch in criteria expression.

What I am trying to delete is every thing after the first ().
I only want to show the #. For example below.

Currently: 16030078016(CNPVG-HKHKG), (HKHKG-USLAX)
What needed: 16030078016

I tried this below...please help.
Left([Master_Bill],InStr(1,[Master_Bill],"(")-1)
 
Well, it goes in the FIELD area, not the criteria:

MasterBill: Left([Master_Bill],InStr(1,[Master_Bill],"(")-1)

But you will see that there are errors when there is nothing there so modify to:
Code:
MasterBill: IIf(InStr(1,[Master_Bill],"(")=0,[Master_Bill],IIf(Len([Master_Bill] & "")=0,"Blank",Left([Master_Bill],InStr(1,[Master_Bill],"(")-1)))
 
Question

Another questions in regards to this ...

What about if something is separated by a semicolon:
KA; CX

Where in the string does it change?
 

Users who are viewing this thread

Back
Top Bottom