ronaldmacdonald
MIS
Hello
I have the following query, I wish to limit the results to
MAX(AS_RecordID) and group by AS_TenancyRef but I get the error "You tried to execute a query that does not include the specified expression 'AS_Date' as part of an aggregate function"
SELECT max(AS_RecordID), AS_TenancyRef, AS_Date, AS_Period, AS_TransType, AS_TransDesc, AS_Debit, AS_Credit, AS_VAT, AS_Balance, Tenancy_TenantID, Property_PropType, Property_Location, Location, Location_Code, Location_Type FROM tblLocationRef INNER JOIN (tblProperty INNER JOIN (tblTenancy INNER JOIN tblAccount_Summary ON tblTenancy.Tenancy_TenancyRef = tblAccount_Summary.AS_TenancyRef) ON tblProperty.Property_PropertyID = tblTenancy.Tenancy_PropertyID) ON tblLocationRef.Location_Code = tblProperty.Property_Location WHERE AS_Balance > 0 AND Location_Type = 'HULL' AND AS_Date >= #01/01/1900# AND AS_Date <= #31/12/2099#
group by AS_TenancyRef
Cheers
Ronald
I have the following query, I wish to limit the results to
MAX(AS_RecordID) and group by AS_TenancyRef but I get the error "You tried to execute a query that does not include the specified expression 'AS_Date' as part of an aggregate function"
SELECT max(AS_RecordID), AS_TenancyRef, AS_Date, AS_Period, AS_TransType, AS_TransDesc, AS_Debit, AS_Credit, AS_VAT, AS_Balance, Tenancy_TenantID, Property_PropType, Property_Location, Location, Location_Code, Location_Type FROM tblLocationRef INNER JOIN (tblProperty INNER JOIN (tblTenancy INNER JOIN tblAccount_Summary ON tblTenancy.Tenancy_TenancyRef = tblAccount_Summary.AS_TenancyRef) ON tblProperty.Property_PropertyID = tblTenancy.Tenancy_PropertyID) ON tblLocationRef.Location_Code = tblProperty.Property_Location WHERE AS_Balance > 0 AND Location_Type = 'HULL' AND AS_Date >= #01/01/1900# AND AS_Date <= #31/12/2099#
group by AS_TenancyRef
Cheers
Ronald