Splitting Text Data

  • Thread starter Thread starter Justin
  • Start date Start date
J

Justin

I need to split up an email address that is stored in a table. For example
if the data is "(e-mail address removed)" I want my query field to display "msn.com".
What would the calculated field be?
 
If the email address is stored as text, you can do this:

field --> Server: Right([email_fieldname], Len([email_fieldname]) -
InStr([email_fieldname],"@"))

if all the email addresses are not filled out, or some are incorrect and
do not contain @, you can add a way to test for that:

field --> Server: IIF(InStr([email_fieldname],"@")>0,
Right([email_fieldname], Len([email_fieldname]) -
InStr([email_fieldname],"@")),"")

WHERE
email_fieldname is the fieldname containing the email address


Warm Regards,
Crystal

Access Basics
8-part free tutorial that covers essentials in Access
http://www.accessmvp.com/Strive4Peace/Index.htm

*
(: have an awesome day :)
*
 
I would use an expression like
Mid([EmailAddress],Instr(1,[EmailAddress],"@")+1)

IF the address contains the @ character you will get all after the "@". If
the address does not contain the @ character, you will get the entire contents
of the field returned.

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 
Back
Top