[mso] Re: Access Query

  • From: Cathy.Evans@xxxxxxxxx
  • To: mso@xxxxxxxxxxxxx
  • Date: Mon, 10 Jan 2005 23:03:51 -0500

Glenda, thanks for the details.  If the data is a new row listing for each
course, you could have multiple listings for the same student, with
different course data.  If that's the case, I'm thinking go ahead and try
the LAST on the subj field, and MAX on the ID.  You should get whatever
data is entered on the MAX id row for that course.  Maybe someone will be
able to jump in with SQL help.

I had a very similar student/classes database problem where originally the
student data was set up in one large table.  I am having to re-do this
database from scratch and normalize the table structure, then try to get
the queries/forms operating again.  In another database where I am getting
data from another system and I'm extracting it  in a single table row
format, I created a normalized table structure and now append the new data
to the tables as needed so it is easier to create forms, queries, reports.
That solved my problem of having to deal with data from an outside source
in its own format.

Hope this helps, Cathy


                                                                                
                       
                      "Glenda Wells"                                            
                       
                      <gwells@xxxxxxxxxxx      To: <mso@xxxxxxxxxxxxx>          
                       
                      >                                                         
                       
                      Sent by:                 cc:                              
                       
                      mso-bounce@freelist                                       
                       
                      s.org                    Subject:  [mso] Re: Access Query 
                       
                      01/10/2005 10:20 PM                                       
                       
                      Please respond to                                         
                   ... 
                      mso                                                       
                       
                                                                                
                       
                                                                                
                       




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.










-----------------------------------------------------------------------------------------------------
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
*************************************************************

Other related posts: