well, I would see what sort of date/time it created vs what the known amount of service should be, and then tweaking the formula until you get the value that you are after.
...perhaps, I have some values backwards in the datediff, I never remember how they work and use examples to make sure that I am getting a value that makes sense.
Just a thought, the goal of the DateDiff part is to determine the difference in days between 2 dates. Cdate will convert the number of days to a calendar date, which will have year, month, and date. Subtract the constant year, which i think is 1900, and you will have...a weird date.
what might be missing is something like:
yr := YEAR(dt) - 1900;
mn :=MONTH(dt);
dy := DAY(dt);
those are the values that you are after...see if they are close.