grab string after @ in email address and before .com

R

ryan

I'm new to sql and am using access. I've been playing around with the
InStr function and have gotten the below query to run and update the
table to show only the text after the @ in a column with all email
addresses. My question is how do i make it a standard select query
instead of updating the current table. Also once i have all of the
email service providers how do i display those in a quantifying way
through a pivotchart or how could i count them using the totals row in
a query. Thanks for any help


UPDATE Table1 SET email = mid(email,instr(email,"@")+1,200);
 
R

Roger Carlson

Try this:

SELECT Mid(email, InStr(email, "@")+1) As Domains FROM Table1

Notes: There is nothing magic about "Domains". Any alias will do. It just
*can't* be "email". Also, if you don't give a length to the Mid function,
it will assume you mean to the end of the string, so you don't need the 200.

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Top