Results 1 to 2 of 2
  1. #1
    FinChase is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2011
    Posts
    20

    Update and append with single query


    I currently have an append query where I use a parameter to select rows from a table called tblReaccruals. I then want to update the month in that group of rows and then append them to another table called tblReaccruals_Reversal. For example, I want to select all the rows with "May" as the criteria in the Month field, update the month field to read "June", and then append those rows to tblReaccrual_Reversal.

    Currently, the only way I can see to do this is to select my rows and insert them into a temporary table, then run an update query to change the month, then run an append query to add those rows to the appropriate table, and then run a some code to delete the temp table. I can automate all those steps with a macro (someone will be running this process every month), but it still seems cumbersome and I wondered if there was another way that involves fewer steps.

    Thanks in advance for any assistance!

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    it's not a update and append (or append and update), it can likely be done with a single append query.

    How are you extracting the month from your current recordset? if it's something like monthname(datepart("m", [PayDate])) you can do something like

    iif(datepart("m", [PayDate]) < 12, monthname(datepart("m", [Paydate]) + 1), monthname(datepart("m", [PayDate]) - 11))

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

Similar Threads

  1. Append Query For Single Record
    By burrina in forum Forms
    Replies: 8
    Last Post: 01-04-2013, 05:12 PM
  2. Append Query For Single Record
    By burrina in forum Queries
    Replies: 3
    Last Post: 12-30-2012, 11:23 PM
  3. Replies: 3
    Last Post: 03-11-2012, 03:35 PM
  4. Append/Update Query -- Need Help!
    By su-san in forum Queries
    Replies: 12
    Last Post: 11-08-2010, 12:52 PM
  5. Multiple UPDATE in single query
    By nishezaman in forum Access
    Replies: 0
    Last Post: 12-13-2009, 01:40 AM

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