Well, at this moment we know only that
Ageing
field is not getting increased, but we don't know what's wrong with your solution. And we know nothing about method used to increase that field!
So, i'd suggest to start with reading article provided in solution 1 by
OriginalGriff[
^].
If you would like to calculate the difference in days between two dates, you can use something like that:
DateTime startDate = new DateTime(2016,10,2);
DateTime endDate = new DateTime (2016,10,5);
var daydiff = (endDate-startDate).TotalDays;
But... if you would like to calculate it on SQL Server, you have to use
DateDiff function[
^]:
SELECT DATEDIFF(DD, '2016-10-02', '2016-10-05') AS Ageing
Good luck!