Full Version: Underlying Query - Orderby Needed ?
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
syswizard
As I am creating several reports, it dawned on me the report has it's own expected sort order.
Should the underlying query have no Orderby clauses or should it have the Orderby match the sort levels of the report ?
Does it matter performance-wise ?
RAZMaddaz
The Order By in the Query does not affect or determine the Order By in the Report and vice versa.
syswizard
Thus if no aggregate verbs are needed in the query as the RecordSource, Orderby clauses should be removed.
RAZMaddaz
QUOTE (syswizard @ May 16 2012, 09:06 AM) *
Thus if no aggregate verbs are needed in the query as the RecordSource, Orderby clauses should be removed.


No, it doesn't have to be removed, it is just not going to determine how the Report is ordered.
syswizard
Why waste resources performing a sort that is not useful ?
RAZMaddaz
QUOTE (syswizard @ May 16 2012, 09:49 AM) *
Why waste resources performing a sort that is not useful ?



True, but to each their own. As well maybe someone wants to see how the data will look/sort in a Query, before seeing it in a Report. But for now, the more important thing is if you understand?

RAZMaddaz
syswizard
Years and years ago, on the mainframe, we had sorts that ran for HOURS.
I've been paranoid ever since about excessive or unwarranted sorting !
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.