Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2016
    Posts
    6

    Unanswered: MS Access VBA Update with Aggregate Query

    I have 2 tables as follows:

    Table1
    EmployeeID
    MonthlyBonus

    Table2
    EmployeeID
    DailyBonus

    Where there is a single unique instance for each employee in Table1 and multiple instances for each employee in Table2.

    I am trying to update Table1 with the Sum() of the DailyBonus for each employee from Table2.

    I have tried a number of different SQL statements to do this to no avail. Does anyone happen to know the correct syntax?

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,482
    Provided Answers: 11
    BACKUP first

    Im lazy can't write in SQL

    What i would do

    create a Query that Sums up the Data First of table 2

    so you get a Query with EmployeeID and TDailyBonus

    Now create a new Query change it to a update Query add Table1 and table2

    Join then by the EmployeeID

    put MonthlyBonus in the White area in the Update To: put the [TDailyBonus] from that Query we made.

    RUN IT

    Now That should update the MonthlyBonus for each EmployeeID base on the Query
    Last edited by myle; 11-30-16 at 17:34. Reason: Spelling
    hope this help

    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.
    DONT WORRY ABOUT THOSE WHO TALK BEHIND YOUR BACK
    THEY'RE BEHIND YOU FOR A REASON

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •