Hello,
I have a table that looks like this:
Account_Number----------Currency-----------PostingDate--------Closing Balance
1234-------------------------USD--------------July 1, 2016----------$100
1234-------------------------USD--------------July 3, 2016----------$100
1234-------------------------USD--------------July 4, 2016----------$120
1234-------------------------USD--------------July 5, 2016----------$160
1234-------------------------USD--------------July 7, 2016----------$180
I need to have records for July 2, 2016 since bank was closed that day and the balance didn't change, so July 2, 2016 should have a record for $100 and July 6, 2016 should have a record for $160.
If anyone could help me with this - it would be great. I spent quite some time on this and nothing would work out. I've added an ALL_DATES table with all dates from Jan 1, 2016 onward. So, I can add an empty record for a missing date, but how do I assume the value. The date gaps could be up to one week, there are numerous accounts numbers with numerous currencies. The example I'm showing here is the simplest possible scenario.
Thank you,
Valeri
I have a table that looks like this:
Account_Number----------Currency-----------PostingDate--------Closing Balance
1234-------------------------USD--------------July 1, 2016----------$100
1234-------------------------USD--------------July 3, 2016----------$100
1234-------------------------USD--------------July 4, 2016----------$120
1234-------------------------USD--------------July 5, 2016----------$160
1234-------------------------USD--------------July 7, 2016----------$180
I need to have records for July 2, 2016 since bank was closed that day and the balance didn't change, so July 2, 2016 should have a record for $100 and July 6, 2016 should have a record for $160.
If anyone could help me with this - it would be great. I spent quite some time on this and nothing would work out. I've added an ALL_DATES table with all dates from Jan 1, 2016 onward. So, I can add an empty record for a missing date, but how do I assume the value. The date gaps could be up to one week, there are numerous accounts numbers with numerous currencies. The example I'm showing here is the simplest possible scenario.
Thank you,
Valeri