This is a basic question and I believe I know the answer but wish to defer to the experts on this prior to attempting this. I'm wondering if there is a way to retrieve data from a database table based on a year... Being more specific:
I will have multiple tables with named 2020Docs, 2021Docs, 2022Docs, 2023Docs, 2024Docs etc.
Each of those tables then would have the exact same column structure.
I am wondering if there is a way to search for a record in, as an example, 2020Docs specifically but still maintain the ability to search into one of the other tables, if required, without having to write a new query each time.
My end thinking is since the DOCS table will contain a years worth of fairly large PDFs, transact time becomes slower and slower as the year progresses and more records are added. Rather than bloating the DB with multiple years of DOCS I was thinking of breaking them into individual years thus keeping transact times within reason.
Ultimately this will be done in a program where once a record is called the document will display on the screen. I have that functionality working but need to seriously speed up the transact time.
So, as a guidance, can I set a parameter, and more specifically, how to pass said parameter to look at a specific DOC table? Additionally, I will also need the ability to write (save documents) to each year's table as documents are produced. The later part will most likely only need to be written to the current years DB as all documents pertaining to the record will have been generated within days of completing a load.
I have not attempted this yet so I have no SQL to show my progress as this is only a preliminary idea for development that I believe will address my slow Transact time.