andreas_udby
Registered User.
- Local time
- Today, 06:42
- Joined
- May 7, 2001
- Messages
- 76
Could I have constructed my joins improperly? Here's the deal:
I have a query that pulls from three other queries:
qrySegment: [Business Segment]
qryHC: [Business Segment] [HC_Sales] [HC_Ops] [HC_Enab] etc.
qry2_Ldr: [Business Segment] [Ldr_EB] [Ldr_SEB] [Ldr_VP] etc.
I'm using the new query to calculate new variables from the previous tables. Here's my SQL statement (tabs and carriage returns provided for clarity):
SELECT qrySegment.[Business Segment],
qryHC.[HC_Sales]+[HC_Ops]+[HC_Enab] AS Ex_Total,
qry2_Ldr.[Ldr_EB]+[Ldr_SEB]+[Ldr_VP] AS Ldr_Total
FROM qry2_Ldr RIGHT JOIN
(qryHC RIGHT JOIN
qrySegment ON
qryHC.[Business Segment] = qrySegment.[Business Segment]) ON
qry2_Ldr.[Business Segment] = qrySegment.[Business Segment];
Now, the new variable "Ex_Total" calculates just fine, but I can't get anything to return for "Ldr_Total", even when I remove the qryHC query and run just the results for the qry2_Ldr calculation. When I select the individual fields from qry2_Ldr, they return just fine also; it's just the calculation that's failing. What have I done wrong?
Thanks,
Andreas
I have a query that pulls from three other queries:
qrySegment: [Business Segment]
qryHC: [Business Segment] [HC_Sales] [HC_Ops] [HC_Enab] etc.
qry2_Ldr: [Business Segment] [Ldr_EB] [Ldr_SEB] [Ldr_VP] etc.
I'm using the new query to calculate new variables from the previous tables. Here's my SQL statement (tabs and carriage returns provided for clarity):
SELECT qrySegment.[Business Segment],
qryHC.[HC_Sales]+[HC_Ops]+[HC_Enab] AS Ex_Total,
qry2_Ldr.[Ldr_EB]+[Ldr_SEB]+[Ldr_VP] AS Ldr_Total
FROM qry2_Ldr RIGHT JOIN
(qryHC RIGHT JOIN
qrySegment ON
qryHC.[Business Segment] = qrySegment.[Business Segment]) ON
qry2_Ldr.[Business Segment] = qrySegment.[Business Segment];
Now, the new variable "Ex_Total" calculates just fine, but I can't get anything to return for "Ldr_Total", even when I remove the qryHC query and run just the results for the qry2_Ldr calculation. When I select the individual fields from qry2_Ldr, they return just fine also; it's just the calculation that's failing. What have I done wrong?
Thanks,
Andreas