dbTalk Databases Forums  

function to isolate the e-mail host from an e-mail name

comp.database.ms-access comp.database.ms-access


Discuss function to isolate the e-mail host from an e-mail name in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bender
 
Posts: n/a

Default function to isolate the e-mail host from an e-mail name - 02-09-2004 , 04:00 PM






Hi. Sorry if this is an old question, but....

i have a table that includes an e-mail address

in a query, i would like to create two columns with expressions for
the hostname and the username.

what function(s) would i use to split the e-mail address to what comes
before the @ and what comes after?

thanks,

Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."

Reply With Quote
  #2  
Old   
Bradley
 
Posts: n/a

Default Re: function to isolate the e-mail host from an e-mail name - 02-10-2004 , 05:40 PM






Try Instr() to find location of the @ symbol in the email address, then
Left() and Right() to extract the text
eg.

Assuming @ will always exist.....

username = Left([myEmail], InStr("@", [myEmail])-1)
hostname = Right([myEmail], Len([myEmail]) - Instr("@", [myEmail])

Or something like that!
--
Bradley
Software Developer www.hrsystems.com.au
A Christian Response www.pastornet.net.au/response

"bender" <larry@netgeexdotcom> wrote

Quote:
Hi. Sorry if this is an old question, but....

i have a table that includes an e-mail address

in a query, i would like to create two columns with expressions for
the hostname and the username.

what function(s) would i use to split the e-mail address to what comes
before the @ and what comes after?

thanks,

Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.