Hi again,
Alright, I've been playing around with the SQL code, and I think I'm close,
but I can't seem to get over the hump.
I found an example is using a SELECT statement in the FROM clause of the SQL
statement, but Access doesn't seem to like it. Is it not allowed in Access?
(I'm using A97).
I tried the following:
SELECT DISTINCT temp_getTotalTestedQuantity.DTL_ITEM_NUM,
temp_getTotalTestedQuantity.DTL_AREA_NUM,
temp_getTotalTestedQuantity.ItemsReviewed,
temp_getTotalDefectQuantity.DefectsSum
FROM
(SELECT tblDetail.DTL_ITEM_NUM, tblDetail.DTL_AREA_NUM,
Sum(tblDetail.DTL_QUAN) AS ItemsReviewed
FROM tblDetail
GROUP BY tblDetail.DTL_ITEM_NUM, tblDetail.DTL_AREA_NUM)
temp_getTotalTestedQuantity,
(SELECT tblDefectCount.DC_ITEM_NUM, tblDefectCount.DC_AREA_NUM,
Sum(tblDefectCount.DC_DF_QUAN) AS DefectsSum
FROM tblDefectCount
GROUP BY tblDefectCount.DC_ITEM_NUM, tblDefectCount.DC_AREA_NUM)
temp_getTotalDefectQuantity
LEFT JOIN temp_getTotalDefectQuantity ON
(temp_getTotalTestedQuantity.DTL_AREA_NUM =
temp_getTotalDefectQuantity.DC_AREA_NUM) AND
(temp_getTotalTestedQuantity.DTL_ITEM_NUM =
temp_getTotalDefectQuantity.DC_ITEM_NUM);
No luck yet. Any suggestions, let me know.
Thanks,
Jay
Jay - 29 Nov 2005 20:38 GMT
My mistake, I hit the wrong button, please see post titled:
Need help trying to combine queries into 1 query
Sorry,
Jay
> Hi again,
>
[quoted text clipped - 31 lines]
> Thanks,
> Jay
Tom Ellison - 29 Nov 2005 20:53 GMT
Dear Jay:
Well, Jet is not as capable as MSDE in such matters.
You should try making a separate saved query of this portion, then
referencing that portion in your larger "outer" query.
Tom Ellison
> My mistake, I hit the wrong button, please see post titled:
> Need help trying to combine queries into 1 query
[quoted text clipped - 40 lines]
>> Thanks,
>> Jay
Jay - 29 Nov 2005 21:11 GMT
Yes, that's looking more and more likely. Chris2 seems to agree with you.
Thanks for the response.
Jay
> Dear Jay:
>
[quoted text clipped - 49 lines]
> >> Thanks,
> >> Jay