Temporal table like functionality for SQL server 2014 or older version - sql-server-2014

Is it possible to create temporal table kind of a functionality to keep history of frequently changing records in SQL server 2014 or older versions. I need to track historical changes in a table (E.g, part X was out of stock for Y number of days in Z period in Inventory table given part number and the date when it is received)

Related

Time as an independant dimension outside the dataset in Quicksight

I am using the KPI visual in quicksight to show the change in a calculated field from one month to the next.
My data is transactional data. Each record in the db includes a "transaction date" and the total dollar amount for the transaction. In the month of December 2021, we recorded no transactions in the database. I am using the transaction date field from this database to drive time based aggregations of the total number of tranasctions and the total value of transactions over a period. I'm also using that date field to drive this KPI visual.
Problem is - my data doesn't have anything for decemeber, so that month doesn't exist in the aggregated result and therefore doesn't show up in my KPI visual.
I was able to get the gap in the timeline to show up with a column chart over time, but not the KPI.
Is there a data analysis concept I don't know about here where time is handled as an independant dimension outside of the dataset?
Usually you would have a date dimension table that contains dates (with the granularity you need for your dashboards).
You would then LEFT JOIN this date dimension table to your table containing the transactional data on the date field. This will make sure that all your transactions are included and if there are not transactions for some particular date, then the left join still includes a row for that date but without any of the fields from your transaction table being populated.

Is there a way to know the number of records added into the SQL database after a particular date and time

The table doesn't have any date time column. I want to if there is any inbuilt keyword which can does that.
I want to know all commits done after a particular date.
If flashback is enabled on the database you can get records on the table in an around a particular date range in Oracle.(It purely depends on if its enabled and for how long the flashback needs to be kept)
You can query to see the data in the table as of 3 days back as follows
select *
from table as of timestamp sysdate-3

MySQL: Dates as column headers

I'm trying to develop a new reporting module for a resource management tool (PHP+Mysql).
I am trying to extract data in the following format from mysql:
I have a table that consists of date and location of multiple people(i.e Office, Home or Client).
Sample Data as in DB.
here date_plotted means the date at which the user is engaged and plotting_date represents when this particular entry was made in the system(the date). So User was plotted to be in office on 30th Oct and the same entry was made on 30th Oct.
Data as in resource table
The resource table represents the user table.
Any suggestions on how to do the same in mysql?
These are the primary tables which needs to be used.
The above table id done in excel for now to represent the outcome.
I'm new to SQL so haven't tried anything yet.
There is a tool for Windows that might simplify this operation. It's made by MySQL and called MySQL for Excel. In theory it should allow you to structure and make changes to MySQL databases as well as perform queries that result in spreadsheets.
Without knowing more about your data, for example being supplied an actual csv file to work with, and the parameters of the actual pull, whether it's fix dates always or if this is a dynamic pull based on a range this question could result in 100 different implementations that visually return similar results, but have massively different requirements overhead-wise in implementation.

How do I store data pertaining to a month or year in Mysql

I receive csv files at the end of each month from my customer for each of their KPI (for example csv's for resumes received, candidates joined, candidates resigned, sales, profits, loss , etc) for that specific month.
I want to be able to query this data inorder to generate reports for any month, day or year. This report will be generated dynamically i.e the admin would specify what rows he would like to have in a report (for eg a report with applications received, applications shortlisted, candidates shortlisted after the 1st interview for the period of jan to july.) for any period of time.
What would be the best way to store the data into my database in order to generate such reports? I am using Mysql as my database.
I am not sure if I would need to flush out the old data from my tables currently. So considering that I keep all the data persistent, what would be the best suited database design for this?
Currently what I do is I have a table for each of their KPI. This table has got a date field which I am using to generate the report. But I am looking for a more optimized way.
Thanks in advance.
It is better to store those values (month or year related values ) in a "Date" type fields which would not need any other manipulation while building reports. The conditions or logic for the specific period of time should be handled in your front end. In this case, the usage of Date field is the optimized way.

MS-Access: updating query for each new linked table each week

First - thanks for your time. My issue lies in my new usage of Access for tracking values from weekly excel reports. Each week I'm given a new excel file with updated values for about 50 employees. These values generally track their performance over 6 different metrics. I've begun to link these excels into an access database to keep and track that data each week. These linked tables are given the name convention of the date that the data is as of - example: 05-05; 05-12; 05-19, 05-26; etc.
My question is - is there a way to build a query to track the change (difference in values) from last week to this week (05-19 to 05-26), automatically? And also taking into account future additions of linked tables so that I don't have to add a piece to the query each week?
In addition, I'm looking to track overall change - first table 05-05 to the most recent linked table (which ever date that's true for, whether it's the end of July, or the end of the year).
Based on these 2 results, I'd eventually build out the query to show every week with their value and in the next column the week over week change (up down or neutral)