Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / June 2006

Tip: Looking for answers? Try searching our database.

Complex Update Queries

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jon - 28 Jun 2006 14:52 GMT
I have two large databases, contacts (~300 records) and master (~2500
records).  Both databases have a column SSN and rank amoung about 30
other columns.  What I need to do copy the rank from master to contacts
where the SSN is the same.

UPDATE contacts
SET contacts.rank = master.rank
FROM contacts, master
WHERE contacts.SSN = master.SSN;

Now Access 2003 gives me errors say I cant have FROM in the query.  I
am about to just copy and paste the 300 values manually since I cant
get this to work.  Any guidance as to how or if such a query can be
done would be great.  Thank you, Jon

PS I also tried this to no avail;
UPDATE contacts
SET rank = (SELECT master.rank FROM master WHERE master.SSN =
contacts.SSN);
Douglas J Steele - 28 Jun 2006 15:23 GMT
Try

UPDATE contacts INNER JOIN master
ON contacts.rank = master.rank
SET contacts.rank = master.rank

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> I have two large databases, contacts (~300 records) and master (~2500
> records).  Both databases have a column SSN and rank amoung about 30
[quoted text clipped - 15 lines]
> SET rank = (SELECT master.rank FROM master WHERE master.SSN =
> contacts.SSN);
Jon - 28 Jun 2006 19:12 GMT
Thank you, that worked perfectly!
Jon
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.