C
Chad
Hello everyone. I am trying to run a query with an imbedded subquery but
continue to get the error "At most one record can be returned from this
subquery."
I have checked and rechecked that the subquery returns only one record based
on the criteria specified. Does anyone have any idea as to why this query
continues to return that error message?
************************************************************
SELECT tblYears.Year_ID, tblMonths.Month_ID, tblResidence.Residence_ID,
(SELECT Temp3.Days FROM qryServiceNightsbyMo As Temp3 WHERE
Temp3.Residence_ID = tblResidence.Residence_ID AND Temp3.Period_ID = Month_ID
AND Temp3.Annual_ID=Year_ID ) AS ServiceDays
FROM tblMonths, tblYears, tblResidence
WHERE (((tblResidence.Residence_History_Code_ID)=461) AND
((tblResidence.From_Date)<=DateSerial([Year_ID],[Month_ID]+1,0)) AND
((tblResidence.To_Date)>=DateSerial([Year_ID],[Month_ID]+1,0)))
GROUP BY tblYears.Year_ID, tblMonths.Month_ID, tblResidence.Residence_ID;
************************************************************
Best,
Chad
continue to get the error "At most one record can be returned from this
subquery."
I have checked and rechecked that the subquery returns only one record based
on the criteria specified. Does anyone have any idea as to why this query
continues to return that error message?
************************************************************
SELECT tblYears.Year_ID, tblMonths.Month_ID, tblResidence.Residence_ID,
(SELECT Temp3.Days FROM qryServiceNightsbyMo As Temp3 WHERE
Temp3.Residence_ID = tblResidence.Residence_ID AND Temp3.Period_ID = Month_ID
AND Temp3.Annual_ID=Year_ID ) AS ServiceDays
FROM tblMonths, tblYears, tblResidence
WHERE (((tblResidence.Residence_History_Code_ID)=461) AND
((tblResidence.From_Date)<=DateSerial([Year_ID],[Month_ID]+1,0)) AND
((tblResidence.To_Date)>=DateSerial([Year_ID],[Month_ID]+1,0)))
GROUP BY tblYears.Year_ID, tblMonths.Month_ID, tblResidence.Residence_ID;
************************************************************
Best,
Chad