Doesn't sort consistantly

  • Thread starter Thread starter Bob Richardson
  • Start date Start date
B

Bob Richardson

When I just look at this query (data sheet view) it's sorted correctly.
However when I use this query in a report, the data is sorted by "HowHeard"
rather than count. What's the solution to hafve it always sorted by count?


SELECT Count(AllData.IdNo) AS CountOfIdNo, DataConference.HowHear
FROM AllData INNER JOIN DataConference ON AllData.IdNo = DataConference.IdNo
GROUP BY DataConference.HowHear, DataConference.Year
HAVING (((Count(AllData.IdNo))>1) AND ((DataConference.HowHear)>"") AND
((DataConference.Year)=[Forms].[RptCentral].[CurYr]))
ORDER BY Count(AllData.IdNo) DESC;
 
An Access Gotcha! In reports Access just throws away any sorting in the
recordset be it table or query. In fact for reports with a lot of records,
you can speed up things by ensuring that sorts are removed in any underlying
queries.

For reports all the sorting and grouping need to be done in the report.
 
WOW. Thanks a lot...it's right now :)

Jerry Whittle said:
An Access Gotcha! In reports Access just throws away any sorting in the
recordset be it table or query. In fact for reports with a lot of records,
you can speed up things by ensuring that sorts are removed in any
underlying
queries.

For reports all the sorting and grouping need to be done in the report.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Bob Richardson said:
When I just look at this query (data sheet view) it's sorted correctly.
However when I use this query in a report, the data is sorted by
"HowHeard"
rather than count. What's the solution to hafve it always sorted by
count?


SELECT Count(AllData.IdNo) AS CountOfIdNo, DataConference.HowHear
FROM AllData INNER JOIN DataConference ON AllData.IdNo =
DataConference.IdNo
GROUP BY DataConference.HowHear, DataConference.Year
HAVING (((Count(AllData.IdNo))>1) AND ((DataConference.HowHear)>"") AND
((DataConference.Year)=[Forms].[RptCentral].[CurYr]))
ORDER BY Count(AllData.IdNo) DESC;
 
Back
Top