[mso] Re: Access Query

  • From: "Glenda Wells" <gwells@xxxxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Mon, 10 Jan 2005 22:20:13 -0500

here's something i might do in SQL to get what i'm looking for. the data is in 
one table with one row per student and course. each student can have many 
courses, each course can have many students. the objective is to get the 
information related to the maximum course as identified by the course_id.
 
student_id
course_id
course_name
course_score
 
select  a.student_uid ,a.course_id, a.course_name, a.course_score 
from courses a 
where a.course_id= 
     (SELECT MAX(b.course_id) 
FROM courses b 
WHERE b.course_id= a.course_id)

        SAMPLE
        last, first, student_uid, course_name, course_id, course_score
        John, Smith, abc123, US History, 01, 4.0
        John, Smith, abc123, Roman History, 02, 3.7
         
        DESIRED RESULT: John, Smith, abc123, Roman History, 02, 3.7
         
        -----Original Message----- 
        From: Cathy.Evans@xxxxxxxxx [mailto:Cathy.Evans@xxxxxxxxx] 
        Sent: Mon 1/10/2005 3:52 PM 
        To: mso@xxxxxxxxxxxxx 
        Cc: 
        Subject: [mso] Re: Access Query
        
        


        Can you copy your straight SQL that works into your SQL view of access? 
 I
        have had some luck copying SQL from other data sources, such as Oracle,
        then pasting it in an access query SQL view.  Sometimes I have to do a
        little editing, but it may be worth a shot.
        
        Also, is your data in one table with a single row for each record, or 
many
        tables containing pieces of the whole information?  Can you post your
        table(s) structure.  Example:
        
        tblExample
        Name
        UID
        Subj
        SubjID
        
        
        
                                                                                
                                            
                              "Glenda Wells"                                    
                                            
                              <gwells@xxxxxxxxxxx      To: <mso@xxxxxxxxxxxxx>  
                                            
                              >                                                 
                                            
                              Sent by:                 cc:                      
                                            
                              mso-bounce@freelist                               
                                            
                              s.org                    Subject:  [mso] Re: 
Access Query                                     
                              01/10/2005 03:22 PM                               
                                            
                              Please respond to                                 
                                       .....
                              mso                                               
                                            
                                                                                
                                            
                                                                                
                                            
        
        
        it's a bear and something I've tried to resolve from time to time.  In
        straight SQL (PL/SQL) I can get the desired result by making a query
        with the table listed twice, first to get the max then to get the
        relationship.  I can't remember what that's called...subquery? not sure.
        Anyway, I was looking for something similar in Access either with SQL or
        VBA. =20
        
        -----Original Message-----
        From: Cathy.Evans@xxxxxxxxx [mailto:Cathy.Evans@xxxxxxxxx]
        Sent: Monday, January 10, 2005 02:49 PM
        To: mso@xxxxxxxxxxxxx
        Subject: [mso] Re: Access Query
        
        
        I'm sorry, am stumped without being able to make additional queries to
        summarize the subject, though I'm sure it can be done, and pretty sure
        the subj field is causing the problem, cause when you remove it, the max
        works fine.
        
        
        
        
        
        
-----------------------------------------------------------------------------------------------------
        The information transmitted is intended only for the person
        or entity to which it is addressed and may contain proprietary, 
        business-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).
        //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
        *************************************************************
        

*************************************************************
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).
//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: