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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expressions 1

Status
Not open for further replies.

Janice7

Technical User
May 28, 2002
24
0
0
US
Hi. I have a list of names and e-mail addresses:

John Doe johndoe@company.com
John Smith johnsmith@anothercomapny.com
... ...

I want to strip the domain name from the e-mail address so that only "company.com" and "anothercompany.com" is left.

Can someone help me with creating this expression?

Thanks :)

Janice

 
This ought to work:
[tt]
UPDATE YourTable
SET email=Mid(email,Instr(email,'@')+1)
WHERE Instr(email,'@')>0
[/tt]
The Instr function determines the position of the @ character. Then the Mid function returns only the characters after that position. I added a WHERE clause to make certain that you don't update any fields that are missing a @ character.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top