Forum Discussion

RAC1978's avatar
RAC1978
Copper Contributor
Apr 02, 2024

Steps to remove certain date range of records in Access

I have a database with about 10 years of records.  We only need two years of history in the current database. How can I move the older data but keep in case we need to review?

 

Roberta

  • How many records are we talking about?
    If less than 100K, I would not bother. Access is fast enough. Just make sure you have good (duplicate) indexes to assist with looking up data.
    Note that you cannot "remove" and "keep" the data at the same time 🙂
    If you insist, what you can do is archive the current version of the FE and BE in a folder on the server, just in case you need it in future, and then delete the old data. I insist on archiving the FE as well, as it may evolve over time and become incompatible with today's BE.
    To delete data, use a Delete query.
    • RAC1978's avatar
      RAC1978
      Copper Contributor
      Around 56k. The database opens slowly and the tables open slowly.
      • George_Hepworth's avatar
        George_Hepworth
        Silver Contributor

        RAC1978 

         

        Can you quantify "slowly"? Seconds? Dozens of seconds?

         

        What operations, specifically, are slow? Simply opening the accdb and waiting for the first form to settle?

         

        What is the design pattern for opening forms? I.e. are forms bound to unfiltered queries, or even whole tables?

         

        What database engine is used for the back end, accdb? SharePoint lists? SQL Server? Something else?

         

        It's not uncommon for certain design patterns that work okay initially, on small recordsets, to be become increasingly sluggish as the number of records grows. Unfortunate design choices begin to make their impact known over time.

         

        Trust me, I am well aware of that problem. This isn't on the same development platform, but I recently found myself relearning this important principle, even though I've been doing database work for more than 20 years. 

         

        The more details you can share about the design of the database application, the more likely someone will have direct suggestions to share. At the end of the process, you may still want to archive older data, but that should be a last resort.

    • RAC1978's avatar
      RAC1978
      Copper Contributor
      What does FE and BE stands for?
  • Skandel590's avatar
    Skandel590
    Copper Contributor
    There are a couple of ways.

    1) you can create a duplicate archive table and move data to the archive table. This makes query fast on the current tables.
    This has served perfectly if the database is not too big. Similarly, same can be achieved creating another database and appending data on archive database.
    • RAC1978's avatar
      RAC1978
      Copper Contributor

      Skandel590 I will look into the steps of getting this done.  I don't want to mess anything up..

      I think you are saying to archive the table in the current database, then delete the unwanted records from the current database?

      • Skandel590's avatar
        Skandel590
        Copper Contributor
        RAC1978,

        Unless I know the database structure I can not suggest much.

        The solution I was suggesting was If your Database resides on server and your end users are MS access app with Linked table, below are option.

        1) Create a duplicate table with different name, Run an append query to append data from the production table to the newly created archive table. Once data appended, you can delete the old records from the production table. However if the tables are relationships are not designed properly, that may not help. but you can try without messing.

        2) Instead of keeping Database on Access, you can migrate to MSSQL (Of course express version which does not cost and free upto 10 GB Database) link the tables in Ms Access which can improve the performance.

        If you can PM me the database relationship, How many tables, How many queries run on main form I may be able to assist.

Resources