Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Sql Sintax.... please help me.....

Author  Topic 

Santal_Maluko
Starting Member

14 Posts

Posted - 2005-01-07 : 09:37:06
I have this 2 Tables

Visitors
----------
VisitorId
VisitorCompany
VisitorCompanyId
-----------------


Companies
------------
CompanyId
CompanyName
------------

I want to get the CompanyName into the VisitorCompany, having the criteria VisitorCompanyId=CompanyId

I've Tried This:
UPDATE Visitors, Companies SET Visitors.VisitorCompany = Companies.CompanyName
WHERE (((Visitors.VisitorCompanyId)=[Companies].[Company_Id]));

but it isn't working.... what is wrong!!!
Edit/Delete Message

Diogo Alves

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-01-07 : 10:57:24
UPDATE V
SET VisitorCompany = C.CompanyName
from Visitors V inner join Companies C on V.VisitorCompanyId=C.Company_Id



Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -