Update Query

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: [email protected] to be [email protected]

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
 
Top