Does any one know how I can insert rows into my data that calculates the DATEDIFF between each Student's last Activity date and the End date in a new column? In the example below I would like to generate a row after each of the rows with red text. It would like it to duplicate the first 4 fields, have a null in the Activity field and 11 in the new column for Student 101 (DATEDIFF 31/01/16 and 20/01/16). Is that possible?
| Course | Start | End | Student | Activity |
| 1 | 1/01/2016 | 31/01/2016 | 101 | 1/01/2016 |
| 1 | 1/01/2016 | 31/01/2016 | 101 | 10/01/2016 |
| 1 | 1/01/2016 | 31/01/2016 | 101 | 11/01/2016 |
| 1 | 1/01/2016 | 31/01/2016 | 101 | 12/01/2016 |
| 1 | 1/01/2016 | 31/01/2016 | 101 | 20/01/2016 |
| 1 | 1/01/2016 | 31/01/2016 | 202 | 2/01/2016 |
| 1 | 1/01/2016 | 31/01/2016 | 202 | 6/01/2016 |
| 1 | 1/01/2016 | 31/01/2016 | 202 | 11/01/2016 |
| 1 | 1/01/2016 | 31/01/2016 | 202 | 20/01/2016 |
| 1 | 1/01/2016 | 31/01/2016 | 202 | 31/01/2016 |
| 1 | 1/01/2016 | 31/01/2016 | 303 | 1/01/2016 |
| 1 | 1/01/2016 | 31/01/2016 | 303 | 20/01/2016 |
| 1 | 1/01/2016 | 31/01/2016 | 303 | 21/01/2016 |
| 1 | 1/01/2016 | 31/01/2016 | 303 | 22/01/2016 |
| 1 | 1/01/2016 | 31/01/2016 | 303 | 30/01/2016 |
| 2 | 1/01/2016 | 31/01/2016 | 101 | 10/01/2016 |
| 2 | 1/01/2016 | 31/01/2016 | 101 | 13/01/2016 |
| 2 | 1/01/2016 | 31/01/2016 | 101 | 19/01/2016 |
| 2 | 1/01/2016 | 31/01/2016 | 101 | 22/01/2016 |
| 2 | 1/01/2016 | 31/01/2016 | 101 | 23/01/2016 |
| 2 | 1/01/2016 | 31/01/2016 | 404 | 5/01/2016 |
| 2 | 1/01/2016 | 31/01/2016 | 404 | 6/01/2016 |
| 2 | 1/01/2016 | 31/01/2016 | 404 | 18/01/2016 |
| 2 | 1/01/2016 | 31/01/2016 | 404 | 24/01/2016 |
| 2 | 1/01/2016 | 31/01/2016 | 404 | 31/01/2016 |
| 2 | 1/01/2016 | 31/01/2016 | 505 | 9/01/2016 |
| 2 | 1/01/2016 | 31/01/2016 | 505 | 11/01/2016 |
| 2 | 1/01/2016 | 31/01/2016 | 505 | 21/01/2016 |
| 2 | 1/01/2016 | 31/01/2016 | 505 | 22/01/2016 |
| 2 | 1/01/2016 | 31/01/2016 | 505 | 30/01/2016 |
Thank tou in advance for your help.
DHB.