[mso] Re: Access Queries

I had a similar situation.  Made a series of aggregate queries per each
item I wanted to show in the row, only placing in the query grid the ID,
then the one item, such as TYPE.  Next query would be aggregate grouping ID
and Position.  My data was similar in that there would be 2 or three
results of each field per ID, so I did a sub query and made a field called
TYPE1, bringing in only the first value.  Next sub query would have a field
called TYPE2 with the next value, and so on till max value.   In my case
there was a max of 4 values per each that could have resulted so I knew
when to stop.

Made final query with original main table, then pulled in each sub query
and did a one to many relationship on them, pulling the unique field total
for each desired item, and lined up as many sub queries as I  needed to get
the whole picture in one row.  I'm not good at explaining it, but maybe
someone who understands what I'm trying to say can explain it better in
technical terms, or point you in a better direction.  Instead of making new
tables, you are grouping the data in individual queries, then bringing all
the subsets into a new query with the main table as the master relationship
source.

hth, Cathy


                                                                                
                                              
                      "Glenda Wells"                                            
                                              
                      <gwells@xxxxxxxxxxx      To: <mso@xxxxxxxxxxxxx>          
                                              
                      >                                                         
                                              
                      Sent by:                 cc:                              
                                              
                      mso-bounce@freelist                                       
                                              
                      s.org                    Subject:  [mso] Re: Access 
Queries  :VSMail mx3                                
                      06/30/2004 05:07 PM                                       
                                              
                      Please respond to                                         
                                        ..... 
                      mso                                                       
                                              
                                                                                
                                              
                                                                                
                                              




I've tried this James but what happens is I get multiple for the same
UID if the UID has more than one type or position...unless maybe I'm
missing a step?

for example.

UID 1010 in a query against the master table may have 3 records

UID     TYPE    POSITION
1010    1       1
1010    1       2
1010    2       2

My result displays UID 1010 3 times, even though I have Group By in the
Total row.

-----Original Message-----
From: James LaBorde [mailto:jlaborde@xxxxxxxxx]
Sent: Wednesday, June 30, 2004 04:47 PM
To: 'mso@xxxxxxxxxxxxx'
Subject: [mso] Re: Access Queries :VSMail mx3

Glenda,

Have you looked into aggregate queries?  Open a new query window and
pull your table in, then select the fields you want.  Next click on the
Summation sign, (it looks like a giant backwards E).  This turns your
query into a summation query and you can group by UID, Type and
Position.  Your end result will be one record for each unique
combination of the three fields.

James

-----Original Message-----
From: Glenda Wells [mailto:gwells@xxxxxxxxxxx]
Sent: Wednesday, June 30, 2004 1:26 PM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Access Queries :VSMail mx3


Hi All.
I pull data in Access like this with multiple types and positions
available. I only want 1 record for each UID in the following order.

UID     Type 1  Position 1
UID     Type 1  Position 2
UID     Type 2  Position 1
UID     Type 2  Position 2

Typically, I do it like this:

make table query to extract Type 1, Position 1 then append queries for
the other records in order listed. the append queries are based on
select queries with a not-in statement so I don't append records that
already have the UID in the original table

The end result is one table with all types and positions represented and
no duplicates.

I do it this way because each Type and Position could be multiple in the
master table.

Is there a better way for this kind of thing...something more
straightforward? Currently it take several steps to get where I'm going
and I want to streamline the process.

make table TypePosition (Type 1 Position 1) select query T1P2 (UID not
already in TypePosition) apn query T1P2 ((UID not already in
TypePosition) select query T2P1 ((UID not already in TypePosition) apn
query T2P1 (UID not already in TypePosition) select query T2P2 (UID not
already in TypePosition) apn query T2P2 (UID not already in
TypePosition)






-----------------------------------------------------------------------------------------------------
The information transmitted is intended only for the person
or entity to which it is addressed and may contain confidential
and/or privileged material. If you are not the intended recipient 
of this message you are hereby notified that any use, review,
retransmission, dissemination, distribution, reproduction or any
action taken in reliance upon this message is prohibited. If you 
received this in error, please contact the sender and delete the 
material from any computer.  Any views expressed in this message
are those of the individual sender and may not necessarily reflect 
the views of the company.  
-------------------------------------------------------------------------------------------------------

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: