[AccessD] Painted into a corner...ORDER BY Solved

Brett Barabash BBarabash at TappeConstruction.com
Thu Mar 13 08:37:01 CST 2003


Um...
If you are using the query as a report recordsource, your ORDER BY clause
has absolutely no effect.  Report sorting is handled by the Sorting &
Grouping dialog in Report design view.


-----Original Message-----
From: John Clark [mailto:John.Clark at niagaracounty.com]
Sent: Thursday, March 13, 2003 8:29 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] Painted into a corner...ORDER BY Solved


I no sooner sent this out, and I got a brainstorm (Ow! My head hurts,
now. Must rest). I changed the Union query's SQL from:

SELECT Findings, Count
FROM qryFindingsCntByPeriod 
UNION SELECT txtResultSpec, Count
FROM qryCountsOne
UNION SELECT txtResult, Count
FROM qryCountsTwo;

Into:

SELECT Findings, Count, "3" AS tag
FROM qryFindingsCntByPeriod 
UNION SELECT txtResultSpec, Count, "1" AS tag
FROM qryCountsOne
UNION SELECT txtResult, Count, "2" AS tag
FROM qryCountsTwo
ORDER BY tag;


This allowed me to dictate the order in the query, and thusly in the
report. I actually have about the same result that I had a couple of
days ago, but it is down to one query and a single report (i.e. no
sub-reports).

John W Clark
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list