Results 1 to 2 of 2
  1. #1
    JanisB is offline Novice
    Windows XP Access 2000
    Join Date
    May 2010
    Posts
    1

    Individual Records


    I have a query that pulls together data from multiple tables based on an ID that . The ID may have one record relating to it, it may have many. The query should only output the FIRST record for each ID number i.e. one row per ID number, despite how many other records may rleate to it. Is this possible?

  2. #2
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    If you have some type of Auto-ID field in the related tables then you can just do something like this. We'll call the unique ID in the related table "UniqueIDField", which would be an auto-number and the field that you use to set your relationship on "RelatedIDField"

    Code:
    SELECT First(Table1.UniqueIDField) AS FirstOfUniqueIDField, Table1.RelatedIDField
    FROM Table1
    GROUP BY Table1.RelatedIDField;
    This will give you the first entry for each related record based on the sequential auto-number id.

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

Similar Threads

  1. Individual weekday count in a month
    By Silver_A in forum Queries
    Replies: 6
    Last Post: 04-16-2010, 08:14 PM
  2. Replies: 3
    Last Post: 03-25-2010, 12:31 PM
  3. individual records in same column on form
    By Sharron in forum Forms
    Replies: 0
    Last Post: 10-04-2008, 09:05 PM
  4. Transferring Individual Records
    By bazillion in forum Programming
    Replies: 0
    Last Post: 01-25-2008, 12:13 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