There is a a table in SQL server that is kind of a history table.
There is always an amount specific to the combination of account + Item + month
Now a report runs every day that puts the day’s date into this history table along with other information.
So for a given combination of (account + item + month) on a specific date, amount can change from date to date. See excel.
Now I want to do a tsql code that does this:
For date = 2/2 and date = 2/1, it grabs the difference of the [amount] for the same combination of (account + Item + month) and ONLY displays the top 2 highest and top two lowest [amount] differences for any combination of (account + Item + month)