[AccessD] Union Query quick question

Heenan, Lambert Lambert.Heenan at AIG.com
Wed Dec 21 13:45:43 CST 2005


Select Distinct * from YourUnionQuery;

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of O'Connor,
Patricia (OTDA)
Sent: Wednesday, December 21, 2005 2:33 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Union Query quick question


Hi All

Quick question on Union Query results - I am having a brain freeze

 If I have 3 groups of data that one group gets filled by each union portion
Is it possible and how do I define the query so that only one record is
produced for each total grouping

Example:  A fills a, B fills b, C fills c.
    
   Select a1,a2,a3,b1,b2,b3,c1,c2,c3
   from table1 
   where x3 = "A"
Union
   Select a1,a2,a3,b1,b2,b3,c1,c2,c3
   from table1 
   where x3 = "B"
Union
   Select a1,a2,a3,b1,b2,b3,c1,c2,c3
   from table1 
   where x3 = "C"

Right now I get 3 records for each group - I would like to only get 1
records with all groups filled.  Could have sworn I have done this before
but just can't get brain to clear

Thanks
Patti
**************************************************
* Patricia O'Connor
* Associate Computer Programmer Analyst
* OTDA - BDMA
* (W) mailto:Patricia.O'Connor at otda.state.ny.us
* (w) mailto:aa1160 at otda.state.ny.us
************************************************** 
--------------------------------------------------------
This e-mail, including any attachments, may be confidential, privileged or
otherwise legally protected. It is intended only for the addressee. If you
received this e-mail in error or from someone who was not authorized to send
it to you, do not disseminate, copy or otherwise use this e-mail or its
attachments.  Please notify the sender immediately by reply e-mail and
delete the e-mail from your system.
-- 
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