Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Append Duplicates (A2k)

    I run two queries, one a make table query, which creates tblEst and want to use an Append To Query to update any records.
    Reading the help files on queries, an Append to query is supposed to add new data to the end of an existing table.
    I'm running an Append to tblEst, all the data is duplicated when checking afterwards.

    Am I missing something ?

    (Breaks added for post only)
    INSERT INTO tblEst ( EST_NO, SUP_NO, REG, OWN_NME, INS_NME, VEH_MOD, BKI_DTE, BKO_DTE, STA, _
    EST_NME, NEW_HRS, RR_HRS, REP_HRS, PTC_HRS, CAN_DES )
    SELECT EST.EST_NO, EST.SUP_NO, EST.REG, EST.OWN_NME, EST.INS_NME, EST.VEH_MOD, EST.BKI_DTE, _
    EST.BKO_DTE, EST.STA, EST.EST_NME, EST.NEW_HRS, EST.RR_HRS, EST.REP_HRS, EST.PTC_HRS, EST.CAN_DES
    FROM EST
    WHERE (((EST.EST_NO)>60000));

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Append Duplicates (A2k)

    Does your make-table query happen to create the same records as those added by the append query?

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Append Duplicates (A2k)

    Yes

    Because there are so many records, via an ODBC source, the make table creates a new table tblEst, I feel its better to work this way so not to disturb the original data.
    The apend was meant to simply update the new table if any records change.
    Thinking about it, it's probably better to re-run the make table, I was just trying to save time.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Append Duplicates (A2k)

    An append query does not update existing records, it simply adds them. You could use an update query to update existing records, but that might be too much work.

    If you have tweaked the design of the table after running the make-table query, you could run a delete query to remove all records, then run an append query to add all records. This way, the structure of the table will be preserved.

  5. #5
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Append Duplicates (A2k)

    Thanks Hans

    Always more than one way to skin a cat !

Posting Permissions

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