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

John Clark John.Clark at niagaracounty.com
Thu Mar 13 10:10:00 CST 2003


You are correct...I just wasn't understanding you at the time. I am
looking at this now thinking, "Yes, I see it plain as day!" 

I have been getting more and more adept with SQL, but I haven't
acquired the confidence or self-assurance yet, so I get all nervous and
jerky, and I start missing things. In this case, my blindness cost me a
couple of extra hours. 

Take care and Thanks!!!

John W Clark



>>> scott.marcus at ae.ge.com 03/13/03 10:04AM >>>
I'm sorry it took you so long to figure this out but, I told you about
this in a
previous response!

<<SELECT '1' as Major, query1.*
FROM query1
UNION
SELECT '2' as Major, query2.*
FROM query2>>

Scott

-----Original Message-----
From: John Clark [mailto:John.Clark at niagaracounty.com] 
Sent: Thursday, March 13, 2003 9: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 
_______________________________________________
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