Outer Joins

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I currntly have a microsoft query which consists of 3 tables. 'STKDETAIL'
'SNTRACE' & 'VIEW_STOCKED_PARTS' with the following joints:

1. 'STKDETAIL' to 'SNTRACE' on field Uniqbatch
2. 'STKDETAIL' to 'VIEW_STOCKED_PARTS' on field part no.

I have tried to change joint 1 to an outer joint so that ALL values from
'STKDETAIL' are shown and records from 'SNTRACE' if appliacable, but it says
the you can't have out joins if there are more than two tables in the query.

How do i get around it.

I have enter the full SQL below if it is easier to change that.

SELECT SNTRACE.Serial_Number, SNTRACE.Batch_Uniq,
STKDETAIL.Unique_Transaction_R, STKDETAIL.Date_Booked,
Sum(STKDETAIL.Add_to_Stock) AS 'Sum of Add_to_Stock', STKDETAIL.Add_to_Stock,
STKDETAIL.Part_Number, STKDETAIL.DrawingIssue, STKDETAIL.Location,
STKDETAIL.Stock_Qty, STKDETAIL.Ex_Job_No, STKDETAIL.UniqBatchLocatioo,
VIEW_STOCKED_PARTS.Part_Description, STKDETAIL.Trans_Memo_Field
FROM FMData.dbo.SNTRACE SNTRACE, FMData.dbo.STKDETAIL STKDETAIL,
FMData.dbo.VIEW_STOCKED_PARTS VIEW_STOCKED_PARTS
WHERE STKDETAIL.Part_Number = VIEW_STOCKED_PARTS.Part_Number AND
STKDETAIL.UniqBatchLocatioo = SNTRACE.Batch_Uniq
GROUP BY SNTRACE.Serial_Number, SNTRACE.Batch_Uniq,
STKDETAIL.Unique_Transaction_R, STKDETAIL.Date_Booked,
STKDETAIL.Add_to_Stock, STKDETAIL.Part_Number, STKDETAIL.DrawingIssue,
STKDETAIL.Location, STKDETAIL.Stock_Qty, STKDETAIL.Ex_Job_No,
STKDETAIL.UniqBatchLocatioo, VIEW_STOCKED_PARTS.Part_Description,
STKDETAIL.Trans_Memo_Field
HAVING (STKDETAIL.Location Like 'BONDED ST') AND
(Sum(STKDETAIL.Add_to_Stock)=1)
 
Try doing the query in MS Access, which does allow multiple outer
joins in most cases and use the Access q.
 

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

Back
Top