Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete to right of ampersand 1

Status
Not open for further replies.

EBOUGHEY

Programmer
Aug 20, 2002
143
US
I would like to delete everything to the right of an '&'

ie: John & Sandra (Remove '& Sandra')

How would this be accomplished?

Thanks for any assistance.
 
cStr = 'John & Sandra'
? SUBSTR(cStr,1,AT('&',cStr)-1)

Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
Darrel, nice that he has 2 options.. a Left() or a Substr() to use..
:)

Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
Here's a third option:

StrExtract("John & Sandra","","&")
 
This worked great. Thanks so much for answering so quickly.


REPLACE ALL t with left(first,at("&",first)-1)
replace all first with t for !empty(t)

 
TecknoSDS,

nice that he has 2 options

...gender here is not always masculine, some of our best members are female. Elena didn't notice or take offense, but I thought I would mention it.

Slighthaze = NULL
craig1442@mchsi.com
"Whom computers would destroy, they must first drive mad." - Anon​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top