Results 1 to 6 of 6
  1. #1
    DougieJ is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    12

    Append from grouped query only appends first record in each group

    I have a query which groups records based on one field. When run as a selection query, it gives the expected output. However when I convert it to an append query, only the first record of each group is appended to the table. What causes this?

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Can you post the SQL code of your query?

    One thing to check is for is key field violations, i.e. if some field must be unique and you are trying to add records that violate that condition, or if some field is required and you are not populating a value.

  3. #3
    DougieJ is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    12
    Thanks - silly me. Yes, it was an index I thought I had deleted.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    Why are you appending aggregate data? Saving calculated data, especially aggregate data, is usually a bad design.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    DougieJ is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    12
    Quote Originally Posted by June7 View Post
    Why are you appending aggregate data? Saving calculated data, especially aggregate data, is usually a bad design.
    Because Access does not have stored procedures. The query interrogates several tables in order to fill certain fields in a report so that the user doesn't have to do it (and get it wrong). Women and fools criticise work they do not understand.

  6. #6
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Women and fools criticise work they do not understand.
    I hope that wasn't a shot at June! She knows more about Access than you or I could ever hope to!

    I think what she was referring to is that Reports can be based off of queries just as easily as they can tables, so it may not be necessary to save any data that can easily be calculated at run-time.

    The general rule of thumb is that you usually do not need to store any data that can be calculated. Doing so may undermine the dynamic nature and integrity of your database (not to mention violate some rules of normalization). However, there are exceptions to the rule (like if you are trying to store historical or "point-in-time" data).

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

Similar Threads

  1. Replies: 3
    Last Post: 10-04-2015, 10:17 AM
  2. Replies: 0
    Last Post: 09-13-2015, 09:07 AM
  3. Group by Field Value and Email Grouped Table
    By NateSmith in forum Programming
    Replies: 2
    Last Post: 01-02-2014, 01:01 PM
  4. Replies: 2
    Last Post: 08-12-2012, 10:56 AM
  5. Assigning grouped attributes to a record
    By owenik in forum Access
    Replies: 3
    Last Post: 10-02-2011, 05:10 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