I may not be doing it right, but now it gives an error on the CDbl($TimeValue2 - $TimeValue1) line. ERROR : Error in expression.!