Results 1 to 3 of 3
  1. #1
    wobvintage3 is offline Novice
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    1

    Limit Query results to 5 contacts per site

    Guys new to the forum looking to learn some tricks and get up to speed quickly.

    Here is my dilemma...



    I have a table of contacts with mailing info and an account number that's one to many. There is no individual id on the file other than the autonum generated when I imported.

    I want to select no more than 5 contacts per account number which I will output and mail. How do I limit my results to no more than 5 per account number?

    Bonus.. I will want to use the above data to use to select the remaining names from this table. How would I go about doing that..?

    Thanks

    Eric

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    go into the SQL view of the query and add "Top 5" after SELECT

  3. #3
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    select * from yourtable as a where contactID in (select top 5 contactIDid from yourtable as b where b.account=a.account)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 05-14-2012, 07:24 AM
  2. Importing Text / Raw Data from a Web Site
    By shibu8 in forum Import/Export Data
    Replies: 1
    Last Post: 11-02-2010, 03:32 PM
  3. Excel Query Limit
    By Afliege in forum Queries
    Replies: 0
    Last Post: 03-19-2010, 10:20 AM
  4. Access to Web Site
    By Rick West in forum Database Design
    Replies: 3
    Last Post: 12-02-2009, 12:54 PM
  5. Replies: 2
    Last Post: 08-04-2008, 04:16 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