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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OUTER JOINS IN SQL 1

Status
Not open for further replies.

Anaheim23

Technical User
Jun 29, 2006
8
US
Hello,

I am trying to create an outerjoin on my tables, which are subqueries). I am familiar with writing them in Microsoft T-SQL, but am having difficulty trying to find the syntax for them in Access. In Microsoft T-SQL, we can use an "*" to mark which table will have a right join. That does not work in Access. I usually put my table joins in the Where clause (Oracle way), but I know Microsoft likes to put them in the From clause.

Here is my sql script:


select*

from
(select
i.invoiceid,
i.InvoiceNum,
i.ConsultantID,
(i.rate*i.billablehrs) as pf
FROM tblinvoice i)i2,

(select
ie.expenseid,
ie.invoiceid,
ie.invoicenum,
ie.amount
from
tblinvoiceexpense ie)ie2

where
i2.invoiceid=ie2.invoiceid
and i2.invoicenum=ie2.invoicenum
 
Code:
select*

from
(select
i.invoiceid,
i.InvoiceNum,
i.ConsultantID,
(i.rate*i.billablehrs) as pf
FROM tblinvoice i)i2

INNER JOIN

(select
ie.expenseid,
ie.invoiceid,
ie.invoicenum,
ie.amount
from
tblinvoiceexpense ie)ie2

ON
i2.invoiceid=ie2.invoiceid
and i2.invoicenum=ie2.invoicenum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top