Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    Denver, Colorado, USA
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Top value for each disting ID (Access 2003)

    Hello,
    I have a table that records when a user logs into a message board. I have fields that record the userID and the time of their login.

    I want to write a query that shows all the distinct userID's and their last login.

    Any ideas?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Top value for each disting ID (Access 2003)

    Create a query based on your table.
    Add the userID and login time fields.
    Select View | Totals to turn the query into a totals query.
    Leave the Total option for the userID field as is (Group By)
    Set the Total option for the login time field to Max.
    Switch to datasheet view.

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Top value for each disting ID (Access 2003)

    Something like :
    SELECT Table.User, Max(Table.LoginTime) AS Lastlogin
    FROM Table
    GROUP BY Table.User;
    Francois

  4. #4
    Lounger
    Join Date
    Jan 2001
    Location
    Denver, Colorado, USA
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Top value for each disting ID (Access 2003)

    Thanks, this did the trick.

Posting Permissions

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