Update Query

H

HRMAC

I need to update the domain name in several email addresses.

Ex: (e-mail address removed) to be (e-mail address removed)

I only need to update the domain name.
 
N

NuBie via AccessMonster.com

i guess you have to create a vba code to do that, but the code below works if
you want to change one set of domain name, i.e.

Ex: (e-mail address removed) to be (e-mail address removed)

All abc.com to abcdef.com, if there are xzy.com those records will be updated
to abcdef.com.

MAKE A BACK UP BEFORE YOU TRY THIS.


UPDATE <Table> SET emailadd = Mid(emailadd,1,InStr(emailadd,"@"))+[enter
domain];
 
J

John Spencer

One method

UPDATE [SomeTable]
SET [EmailAddress] = Replace([EmailAddress],"@abc.com","@abcdef.com")
WHERE [EmailAddress] like "*@ABC.Com"

OR

UPDATE [SomeTable]
SET [EmailAddress] = Left([EmailAddress],Instr(1,[EmailAddress],"@")) &
"abcdef.com")
WHERE [EmailAddress] like "*@ABC.Com"




John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top