In the attached worksheet I have two tabs. The first tab is example data I am working with. The second tab is the result I am looking for. The data lives in a MS Access 2016 database.
I worked with a expert on this forum seeking a query solution. However he recommended VBA as a solution.
What I need to do is to loop the sorted table in VBA and then, record by record, find the count of days between each originatordn and the previous record.
Then append the record to a new table.
The goal is to calculate the days since last call for every originatordn.
originatordn Date Month Year DaysSinceLastCall
2053843380 01-Jan-17 1 2017 0
2053843380 03-Jan-17 1 2017 2
2053843380 05-Jan-17 1 2017 2
2053843380 08-Jan-17 1 2017 3
2053843380 18-Jan-17 1 2017 10
2053843380 28-Jan-17 1 2017 10