Outer Join SQL Server table with Access table, How ?

B

Bing

I set up a linked server in SQL Server 2005, called Sysco.

I have a table call 'Sysco History'

To query access it, I can use
select *
from Syco...[Sysco History]

But, I can figurate how to do a join with a SQL Server table,
OriginalInvoices
from SQL Management Studio.

I try this,

select *
from OriginalInvoice
Right Outer join on OriginalInvoice.Invoice = Syco...[Sysco History].Invoice

but it does not work.

Thanks for your help.
 
S

Sylvain Lafontaine

Try:

select *
from OriginalInvoice
Right Outer join Syco...[Sysco History] on OriginalInvoice.Invoice =
Syco...[Sysco History].Invoice

Or with aliases:

select *
from OriginalInvoice as OI
Right Outer join Syco...[Sysco History] SH on OI.Invoice = SH.Invoice

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)
 
S

Sylvain Lafontaine

From personal experience, it's also a bad idea to use Right Outer Join
instead of Left Outer Join because they are much harder to read and
understand (follow) for the human mind.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)
 

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