Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2008
    Posts
    21

    Unanswered: Append table query problem

    I have an append table query and can't figure out how to append the records to the table being appended if:

    1) The data in and one of three fields, named "Ack_Date", "Resch_Date", OR "Ord_qty" has changed from previous records appended to the table

    or if,

    2) The record is not currently in the table.

    The table being appended is named "tblRunCounterChanges". The key field is named "OpenOrdRecID".

    Can anyone help with this?
    --Steve

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    You'll have to give a little more detail for your first problem.

    For the 2nd one, you just need a simple insert query:

    INSERT INTO TABLE1(FIELD1, FIELD2)
    SELECT TABLE2.FIELD1, TABLE2.FIELD2
    FROM TABLE2 LEFT JOIN TABLE1 ON TABLE2.RECID=TABLE1.RECID
    WHERE TABLE1.RECID IS NULL
    Inspiration Through Fermentation

  3. #3
    Join Date
    Mar 2008
    Posts
    21
    Somehow I was hoping to handle this with just one update query. The first part should have read...

    1) The data in ANY ONE of three fields, named "Ack_Date", "Resch_Date", OR "Ord_qty" has changed from previous records appended to the table

  4. #4
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    So you have two tables, with the same fields? And if a record in table2 is different than the corresponding record in table1, you want to add that record to table1?
    Inspiration Through Fermentation

Posting Permissions

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