John Clark
John.Clark at niagaracounty.com
Thu Mar 13 07:55:00 CST 2003
ORDER BY doesn't do it, because I can only seem to be able to use "Findings" or "Count" and these don't do it for me. "Findings" is the default anyhow, and "Count" would be of no use. Just as an FYI...it was news to me anyhow...I was able to use "ORDER BY Findings" after the first select statement and after the last, with the same results. I guess this makes sense. Also, it occurs to me that I may not be clear in what I want. I want this: Findings Count ADC 79 CASES W/NO ERRORS FOUND 102 CASES W/NO ERRORS FOUND ADC 28 CASES W/NO ERRORS FOUND HR 27 CASES W/NO ERRORS FOUND MA 23 CASES W/NO ERRORS FOUND NPA FS 24 DENIED / WITHDRAWN 104 DENIED / WITHDRAWN ADC 24 DENIED / WITHDRAWN HR 27 DENIED / WITHDRAWN MA ONLY 26 DENIED / WITHDRAWN NPA FS 27 GRANT REDUCTION 102 GRANT REDUCTION ADC 27 GRANT REDUCTION HR 25 GRANT REDUCTION MA 24 GRANT REDUCTION NPA FS 26 HR 79 MA 47 MA ONLY 26 NPA FS 77 To look like this: Findings Count CASES W/NO ERRORS FOUND ADC 28 CASES W/NO ERRORS FOUND HR 27 CASES W/NO ERRORS FOUND MA 23 CASES W/NO ERRORS FOUND NPA FS 24 DENIED / WITHDRAWN ADC 24 DENIED / WITHDRAWN HR 27 DENIED / WITHDRAWN MA ONLY 26 DENIED / WITHDRAWN NPA FS 27 GRANT REDUCTION ADC 27 GRANT REDUCTION HR 25 GRANT REDUCTION MA 24 GRANT REDUCTION NPA FS 26 CASES W/NO ERRORS FOUND 102 DENIED / WITHDRAWN 104 GRANT REDUCTION 102 ADC 79 HR 79 MA 47 MA ONLY 26 NPA FS 77 * The spaces aren't necessary...I am just emphasizing the different groupings. I have basically decided to present what I have to them...I have really got to get this off of my plate, even if I have to come back to it later. I have all the data they need, only it isn't in the format that they are used to. I think I have actually gotten more caught up in it than I needed to. They don't seem that picky, but I don't like not being able to do something, which is my problem, and I don't have time to be this way right now. I would like to thank everybody for their help though...my skills as an Access/VBA programmer have grown so much, and it is directly linked to my participation on this list. Thanks again! John W Clark >>> scott.marcus at ae.ge.com 03/12/03 01:42PM >>> John, Check out the queries I gave you earlier for doing this all in queries. You see that you can add a constant to each of your queries in the union that will sort the types within your groups(each sub-query). It looks like this... SELECT '1' as Major, query1.* FROM query1 UNION SELECT '2' as Major, query2.* FROM query2 Drew is correct. Add the ORDER BY clause to the last query in the union. Scott -----Original Message----- From: Drew Wutka [mailto:DWUTKA at marlow.com] Sent: Wednesday, March 12, 2003 1:33 PM To: 'accessd at databaseadvisors.com' Subject: RE: [AccessD] Painted into a corner I think to 'sort' a Union Query, you put the Field to sort by in the last union segment. (Maybe it needs to be in all....) Sorry, running on about 2 hours of sleep, and I'm already starting to feel drained...(and it's only noon here). Drew