+ Reply to Thread
Results 1 to 2 of 2

Microsoft Query SQL not deleting old data

  1. #1
    Registered User
    Join Date
    06-01-2022
    Location
    United States
    MS-Off Ver
    2021
    Posts
    5

    Microsoft Query SQL not deleting old data

    Hi everyone,

    I have an inventory watchlist report built using microsoft query to our sql database.

    When I refresh the data query, the products duplicate and old data is saved.


    For example product (123) has 0 on hand and 20 on work orders as of (6/21/2022)

    When I refresh the connection today, a new row is added for the same product (123) but with updated inventory - ex: 10 on hand 10 on work orders.


    That leaves me with duplicate rows in excel, which confuses my lookup functions in other sheets.

    Does anyone know how to remove old data and update the excel table to new data without duplicating a product in a new row?

  2. #2
    Forum Contributor
    Join Date
    02-25-2022
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365
    Posts
    174

    Re: Microsoft Query SQL not deleting old data

    I have a column in the Excel table called CreatedTime. When I had to do this I look for the latest CreatedTime in the Excel table and only add records greater than the latest CreatedTime.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Microsoft Query - Data Output table (VBA)
    By alan2624 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-31-2014, 10:48 AM
  2. [SOLVED] Returning data from Microsoft Query to Excel
    By rainbowforest in forum Excel General
    Replies: 3
    Last Post: 06-27-2013, 05:17 AM
  3. Excel won't get data from Microsoft Query
    By m0ngr31 in forum Excel General
    Replies: 0
    Last Post: 03-14-2013, 02:32 PM
  4. Microsoft query data formating question
    By Krisztyan1977 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-12-2010, 02:23 PM
  5. returning data from microsoft query
    By mintmin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-08-2009, 02:13 AM
  6. Microsoft Query: retrieve data by dates
    By Raminhos in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2005, 01:06 PM
  7. [SOLVED] Using Microsoft Query data in a pivot table.
    By slapana in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-11-2005, 01:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1