Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Tables From 2 Different DB using JOINS

Status
Not open for further replies.

Miked811

Programmer
Apr 17, 2005
61
CA
Hi Guys,

How do i query tables from 2 different databases using "JOINS" and without doing a "link" from the other database.

I can do this:

SELECT TblName.* FROM TblName IN 'c:\DB\DBName.mdb'

I tried to add a JOIN but it says syntax error FROM...Please help

Thanks
 
Code:
SELECT TimeSheet.* FROM TimeSheet 
inner join (SELECT Employees.* FROM Employees IN '\\Server\DATA\pwdocs\be.mdb')em ON TimeSheet.Empid = em.Empid
IN '\\Server\DATA\pwdocs\timeclockbe.mdb'
 
if both tables are in the same remote db you can use this sql statement

Code:
SELECT TimeSheet.* FROM TimeSheet 
inner join Employees as em ON TimeSheet.Empid = em.Empid
IN '\\Server\DATA\pwdocs\timeclockbe.mdb'
 
Thank you very much pwise, it worked...I have to do some adjustments with the remote DBs and wella...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top