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
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