+ Reply to Thread
Results 1 to 4 of 4

Student/lecture latest query

  1. #1
    Registered User
    Join Date
    01-14-2016
    Location
    toronto
    MS-Off Ver
    2013
    Posts
    7

    Student/lecture latest query

    Lectures presented by all the students during the last year has been stored in a talbe named: studentlectures, with these fields : ID, studentname, lecturesubject, lecturedate
    For example:
    1, john, mathematics, 2/3/2012
    2, jack, chemistry, 10/3/2012 ,
    3,john, engineering, 15/3/2012
    4,jack ,chemisty,20/3/2012
    5,john,politics,30/3/2012
    6,john,engineering, 15/4/2012
    7,jack,politics,15/4/2012
    We want a query to show the latest record for each student with a specific lecture. For the above example the result will be:
    1, john, mathematics, 2/3/2012
    4, jack , chemisty,20/3/2012
    5,john, politics,30/3/2012
    6, john, engineering, 15/4/2012
    7, jack,politics,15/4/2012
    Previous subject records by each student are not shown, and only the latest one is shown.
    Thank you

    there is an unanswered old cross link this question, but i was not allowed to post the link.

  2. #2
    Registered User
    Join Date
    08-23-2018
    Location
    Ireland
    MS-Off Ver
    Office365
    Posts
    17

    Re: Student/lecture latest query

    This should do the trick.

    I wasn't sure what to do with ID and be aware that you will have multiple Johns and Jacks rolled together unless you add another field like StudentID to the query

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-14-2016
    Location
    toronto
    MS-Off Ver
    2013
    Posts
    7

    Re: Student/lecture latest query

    thank you very much.
    If my table had only three fields groupby would finelywork. In fact the real table has other fields, such as professorname,audiancenumbers, roomname, and else. If i make others "groupby" as well, i dont get only the last reacord for a given student/lecture. what should i do to other fields?

  4. #4
    Registered User
    Join Date
    08-23-2018
    Location
    Ireland
    MS-Off Ver
    Office365
    Posts
    17
    No problem - for a fuller answer please let us know what the output required is, and the field tgat you want to use from the source table(s)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 7
    Last Post: 04-24-2018, 12:07 AM
  2. [SOLVED] Query that will identify latest record - VLookup???
    By RW68701 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-28-2015, 04:08 PM
  3. Replies: 3
    Last Post: 10-10-2014, 12:06 AM
  4. Replies: 9
    Last Post: 11-28-2013, 05:20 PM
  5. Microsoft Query Getting the row with the latest date
    By johncassell in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-19-2013, 04:03 AM
  6. Replies: 3
    Last Post: 01-08-2013, 12:13 PM
  7. Finding latest date with query
    By sumdumgai in forum Access Tables & Databases
    Replies: 1
    Last Post: 10-03-2010, 12:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1