SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Jan 2002
    Location
    Omaha, NE
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Grouping ina access query?

    I would like to group by a ParentID, then sort that group based on date.
    I have name, title,ParentId,Date as fields in my query. What is the best access sql to do this?

    What have just seems to order by date, not group the parentids, then order by date...

    Thanks
    "Oh, you hate your job? Why didn't you say so? There's a support group for that.
    It's called EVERYBODY, and they meet at the bar."

    --Drew Carey

  2. #2
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,264
    Mentioned
    115 Post(s)
    Tagged
    1 Thread(s)
    This should work. Just change the ParentID and Date directions according to how you want them displayed....
    Code:
    SELECT Title, ParentID, Date
       FROM TableName
     GROUP By ParentID, Date, Title
     ORDER By ParentID ASC, Date DESC
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse


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
  •