A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

extract part of email after @



 
 
Thread Tools Display Modes
  #1  
Old April 10th, 2010, 03:37 AM posted to microsoft.public.access
Song[_4_]
external usenet poster
 
Posts: 43
Default extract part of email after @

How to parse email and extract part that after @ sign?
  #2  
Old April 10th, 2010, 04:15 AM posted to microsoft.public.access
GP George[_2_]
external usenet poster
 
Posts: 49
Default extract part of email after @

Right([email],Len([email])-InStr([email],"@"))

That ought to do it.



"Song" wrote in message
...
How to parse email and extract part that after @ sign?


  #3  
Old April 10th, 2010, 06:34 AM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default extract part of email after @

On Fri, 9 Apr 2010 19:37:45 -0700 (PDT), Song wrote:

How to parse email and extract part that after @ sign?


Mid([email], InStr([email], "@") + 1)

will work (the third argument to Mid is optional; if omitted it returns to the
end of the string).

--

John W. Vinson [MVP]
  #4  
Old April 10th, 2010, 06:34 AM posted to microsoft.public.access
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default extract part of email after @

"GP George" wrote in message
...
Right([email],Len([email])-InStr([email],"@"))

That ought to do it.



Or

Mid([email], Instr([email], "@") + 1)

Or

Split([email], "@")(1)

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

  #5  
Old April 11th, 2010, 12:42 AM posted to microsoft.public.access
David W. Fenton
external usenet poster
 
Posts: 3,373
Default extract part of email after @

"Dirk Goldgar" wrote in
:

Split([email], "@")(1)


Split() works in code, but not in a query.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
  #6  
Old April 12th, 2010, 04:56 AM posted to microsoft.public.access
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default extract part of email after @

"David W. Fenton" wrote in message
36.98...
"Dirk Goldgar" wrote in
:

Split([email], "@")(1)


Split() works in code, but not in a query.



True, though I don't believe the OP specified that the expression needed to
work in a query.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

  #7  
Old April 12th, 2010, 07:30 PM posted to microsoft.public.access
David W. Fenton
external usenet poster
 
Posts: 3,373
Default extract part of email after @

"Dirk Goldgar" wrote in
:

"David W. Fenton" wrote in message
36.98...
"Dirk Goldgar" wrote in
:

Split([email], "@")(1)


Split() works in code, but not in a query.


True, though I don't believe the OP specified that the expression
needed to work in a query.


No, but I think an answer to a question that's not specific needs to
account for both possibilities.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
  #8  
Old April 12th, 2010, 07:57 PM posted to microsoft.public.access
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default extract part of email after @

"David W. Fenton" wrote in message
36.82...
"Dirk Goldgar" wrote in
:

"David W. Fenton" wrote in message
36.98...
"Dirk Goldgar" wrote in
:

Split([email], "@")(1)

Split() works in code, but not in a query.


True, though I don't believe the OP specified that the expression
needed to work in a query.


No, but I think an answer to a question that's not specific needs to
account for both possibilities.



Quite right. My first post was just to show a couple of other ways to skin
this cat (poor critter!), but it would have been better if I'd thought of
the query issue.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

 




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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:26 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.