OK to use double joins in Query by Design grid?

S

scs

Is it "OK" to use double joins in the query design grid? In order to get
the info I needed I created two queries and then joined them together in
another query. I'm sure that part is ok, but what I had to do was join them
by CustomerID to CustomerID and another join from MinOfStartDate to
StartDate. It works! I have never seen these double joins mentioned in any
of the books I have on Access. Are they somthing that other people use?
I'm wondering if it is a bad idea? Here is the resulting SQL:

SELECT qryFullNameMinStartDate.CustomerID,
qryFullNameMinStartDate.MinOfStartDate, qryPayment.StartDate,
qryFullNameMinStartDate.Name, qryPayment.Description,
qryPayment.RenewalDate, qryPayment.PaymentAmount,
(([PaymentAmount]/([RenewalDate]-[StartDate]))*365)/12 AS EstMonthlyRev
FROM qryFullNameMinStartDate INNER JOIN qryPayment ON
(qryFullNameMinStartDate.CustomerID = qryPayment.CustomerID) AND
(qryFullNameMinStartDate.MinOfStartDate = qryPayment.StartDate)
WHERE (((qryPayment.StartDate) Between Date() And
Date()-[Forms]![frmPrintMembershipNew].[txtNumberOfDays]))
ORDER BY qryFullNameMinStartDate.CustomerID;

I'm planning to learn SQL so I can hopefuly do things more efficiently. Any
advice will be appreciated.

Thanks
Steve
 
A

Abdul Basit

It rather better to say composite key than double join. You may join two
tables having more than one key for joining to fulfil your criteria
 
J

John Vinson

Is it "OK" to use double joins in the query design grid?

Up to dectuple joins (ten fields) works. Where it's the right thing to
do, it's very efficient and very appropriate.


John W. Vinson[MVP]
 
S

scs

Thanks much!

John Vinson said:
Up to dectuple joins (ten fields) works. Where it's the right thing to
do, it's very efficient and very appropriate.


John W. Vinson[MVP]
 
Top