G
Guest
I'm trying to run a query that will determine the maximum value for a
calculated field from another query. I've run the exact same query syntax on
several other queries based on other tables and they work just fine, but for
some reason this one does not. I've run a Max query on the underlying table
and that works fine, but when I run the max query after calculating it
returns the value 8 as the Max value even though I have values for 10 and 15
in that field. I've even gone back the original data and re-entered it and
made sure all fields are set to long integer and that field properties of the
calculated field ([LMSCOMU]) and query Max field are set to general number
format. I've included the SQL syntax for the query below. Any suggestions
would be greatly appreciated!
SELECT tblColony_counts.Date, Avg(qryLMSavgCOMU.LMSCOMU) AS AvgOfLMSCOMU,
Max(qryLMSavgCOMU.LMSCOMU) AS MaxOfLMSCOMU
FROM tblColony_counts INNER JOIN qryLMSavgCOMU ON
tblColony_counts.ColonyCountID = qryLMSavgCOMU.ColonyCountID
GROUP BY tblColony_counts.Date
HAVING (((tblColony_counts.Date) Between [Enter Beginning Date] And [Enter
Ending Date]));
Cheers,
Peter
calculated field from another query. I've run the exact same query syntax on
several other queries based on other tables and they work just fine, but for
some reason this one does not. I've run a Max query on the underlying table
and that works fine, but when I run the max query after calculating it
returns the value 8 as the Max value even though I have values for 10 and 15
in that field. I've even gone back the original data and re-entered it and
made sure all fields are set to long integer and that field properties of the
calculated field ([LMSCOMU]) and query Max field are set to general number
format. I've included the SQL syntax for the query below. Any suggestions
would be greatly appreciated!
SELECT tblColony_counts.Date, Avg(qryLMSavgCOMU.LMSCOMU) AS AvgOfLMSCOMU,
Max(qryLMSavgCOMU.LMSCOMU) AS MaxOfLMSCOMU
FROM tblColony_counts INNER JOIN qryLMSavgCOMU ON
tblColony_counts.ColonyCountID = qryLMSavgCOMU.ColonyCountID
GROUP BY tblColony_counts.Date
HAVING (((tblColony_counts.Date) Between [Enter Beginning Date] And [Enter
Ending Date]));
Cheers,
Peter