Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Matt,
    Did you see/use the alias FROM table1 AS xx?
    There are only 3 LandingPages in the sample database.



    With this query
    Code:
    SELECT table1.LandingPage, table1.Keyword, Sum(table1.sessions) AS CountSessions
    FROM table1
    WHERE (((table1.keyword) In (SELECT TOP 15 xx.keyword
            FROM table1 AS xx
            WHERE xx.landingpage = table1.landingpage
            GROUP BY xx.landingpage
                ,xx.keyword
            ORDER BY xx.landingpage ASC
                ,sum(xx.sessions) DESC
            )))
    GROUP BY table1.LandingPage, table1.Keyword
    ORDER BY table1.LandingPage, Sum(table1.sessions) DESC , table1.Keyword;
    I get this result (partial display)

    Click image for larger version. 

Name:	forMattTop15.PNG 
Views:	10 
Size:	44.4 KB 
ID:	44092

    We still may not be on the same topic, but hopefully the subquery shows the basic set up involved.

  2. #17
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Matt,

    Did you find an issue? Is this the output you expected?

    I removed the space in "Landing Page" and made my field name "LandingPage" .

    You can rename that field (all instances) back to your name and run the code. Should work.

  3. #18
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199
    @orange, no I wasn't even to get the output you pasted above using the same code. However I know you're on the right track by creating a sub-query and I truly appreciate your trying to help.

  4. #19
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. querying for dimensions
    By btappan in forum Access
    Replies: 7
    Last Post: 04-25-2017, 02:58 PM
  2. Replies: 3
    Last Post: 10-20-2015, 02:03 PM
  3. Replies: 6
    Last Post: 10-01-2013, 08:23 AM
  4. Package dimensions query
    By aflamin24 in forum Queries
    Replies: 3
    Last Post: 10-23-2012, 07:26 PM
  5. code to determine correct dimensions
    By mbar in forum Programming
    Replies: 3
    Last Post: 05-03-2012, 04:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums