Drew Wutka
DWUTKA at marlow.com
Wed Mar 12 12:34:00 CST 2003
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 -----Original Message----- From: John Clark [mailto:John.Clark at niagaracounty.com] Sent: Wednesday, March 12, 2003 10:44 AM To: accessd at databaseadvisors.com Subject: RE: [AccessD] Painted into a corner This works...but...I get it in the following order, when I run the query: 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 These are the correct numbers, but I cannot figure out anything that I can order it by. I am going to try a few more things, but then, I just have to pump it out to them. I have another program waiting, that has a April 1st deadline, and I don't know if I could meet that mark, even if I started on it today. I really appreciate your help, and I learned a lot from this too! Thanks! >>> DWUTKA at marlow.com 03/11/03 04:54PM >>> No problem. Just remember that the Unions can be the true SQL too. So the various querries could actually be in the Union Query, instead of making the Union query's SQL point to them. (Does that make sense?) Go get some rest! <grin> Drew -----Original Message----- From: John Clark [mailto:John.Clark at niagaracounty.com] Sent: Tuesday, March 11, 2003 3:36 PM To: accessd at databaseadvisors.com Subject: RE: [AccessD] Painted into a corner Actually, No, you did not make this complex...I think I actually understand everything that you are saying. I am attempting to try this now, but I think I am going to surrender for the evening. I am getting some interesting results, but I am tired and need a break. When I say interesting, I actually mean that they are promising. I'll pick it up again at 7:30AM tomorrow! So far, I am using: SELECT Findings, Count FROM qryFindingsCntByPeriod UNION SELECT txtResultSpec, Count FROM qryCountsOne UNION SELECT txtResult, Count FROM qryCountsTwo; Thank you very much for your help! Good Night! John W Clark >>> DWUTKA at marlow.com 03/11/03 02:19PM >>> John, just use a Union query. A union query in Access must be written in SQL, but it's pretty simple. Let's say you had this table: tblClients: FirstName LastName and this table: tblPersonnel: FirstName LastName Now, let's say we had this data: tblClients: FirstName LastName Bob Smith George Blue Harry Jones tblPersonnel: FirstName LastName John Jacobs Greg Myst Anna Grant Okay, now you want a query to show both your clients and your personnel in the same fields. To show just the clients, this SQL would work: Select FirstName, LastName