Hi there
I wonder if you can help me, the following SQL works with no trouble at all:
SELECT Trade.Trade, CDate([year] & "-" & [month] & "-01") AS CalcDate, (Avg([Resp])*8)/80 AS [Percent]
FROM (Trade INNER JOIN ContractorDetails ON Trade.TradeID = ContractorDetails.TradeID) INNER JOIN ContJobQueResMonYearLink ON ContractorDetails.[Contractor ID] = ContJobQueResMonYearLink.CoID
GROUP BY Trade.Trade, CDate([year] & "-" & [month] & "-01")
HAVING (((CDate([year] & "-" & [month] & "-01"))>=CDate([forms]![dateselect3]![year] & "-" & [forms]![dateselect3]![month] & "-01") And (CDate([year] & "-" & [month] & "-01"))<=CDate([forms]![dateselect3]![toyear] & "-" & [forms]![dateselect3]![tomonth] & "-01")))
ORDER BY Trade.Trade;
But when I try to extend this to include another field which belongs in another query called PartnershipName Access tells me that the expression is too complex (please see below) - any ideas why?
SELECT [NewExcelOutputPartner contract subquery].[Partnership Name], Trade.Trade, CDate([year] & "-" & [month] & "-01") AS CalcDate, Avg([resp])*8/80 AS [Percentage Average]
FROM ([NewExcelOutputPartner contract subquery] INNER JOIN ContractorDetails ON [NewExcelOutputPartner contract subquery].CoID=ContractorDetails.[Contractor ID]) INNER JOIN Trade ON ContractorDetails.TradeID=Trade.TradeID
GROUP BY [NewExcelOutputPartner contract subquery].[Partnership Name], Trade.Trade, CDate([year] & "-" & [month] & "-01")
HAVING (((CDate([year] & "-" & [month] & "-01"))>=CDate(forms!dateselect3!year & "-" & forms!dateselect3!month & "-01") And (CDate([year] & "-" & [month] & "-01"))<=CDate(forms!dateselect3!toyear & "-" & forms!dateselect3!tomonth & "-01")))
ORDER BY [NewExcelOutputPartner contract subquery].[Partnership Name], Trade.Trade;
I wonder if you can help me, the following SQL works with no trouble at all:
SELECT Trade.Trade, CDate([year] & "-" & [month] & "-01") AS CalcDate, (Avg([Resp])*8)/80 AS [Percent]
FROM (Trade INNER JOIN ContractorDetails ON Trade.TradeID = ContractorDetails.TradeID) INNER JOIN ContJobQueResMonYearLink ON ContractorDetails.[Contractor ID] = ContJobQueResMonYearLink.CoID
GROUP BY Trade.Trade, CDate([year] & "-" & [month] & "-01")
HAVING (((CDate([year] & "-" & [month] & "-01"))>=CDate([forms]![dateselect3]![year] & "-" & [forms]![dateselect3]![month] & "-01") And (CDate([year] & "-" & [month] & "-01"))<=CDate([forms]![dateselect3]![toyear] & "-" & [forms]![dateselect3]![tomonth] & "-01")))
ORDER BY Trade.Trade;
But when I try to extend this to include another field which belongs in another query called PartnershipName Access tells me that the expression is too complex (please see below) - any ideas why?
SELECT [NewExcelOutputPartner contract subquery].[Partnership Name], Trade.Trade, CDate([year] & "-" & [month] & "-01") AS CalcDate, Avg([resp])*8/80 AS [Percentage Average]
FROM ([NewExcelOutputPartner contract subquery] INNER JOIN ContractorDetails ON [NewExcelOutputPartner contract subquery].CoID=ContractorDetails.[Contractor ID]) INNER JOIN Trade ON ContractorDetails.TradeID=Trade.TradeID
GROUP BY [NewExcelOutputPartner contract subquery].[Partnership Name], Trade.Trade, CDate([year] & "-" & [month] & "-01")
HAVING (((CDate([year] & "-" & [month] & "-01"))>=CDate(forms!dateselect3!year & "-" & forms!dateselect3!month & "-01") And (CDate([year] & "-" & [month] & "-01"))<=CDate(forms!dateselect3!toyear & "-" & forms!dateselect3!tomonth & "-01")))
ORDER BY [NewExcelOutputPartner contract subquery].[Partnership Name], Trade.Trade;