Select cResult1
Scan
lnStartDateTime = start
lnEndDateTime = end
* do math
replace next 1 total_time with result IN cResult1
Endscan
and if the math isn't complicated or you put it in a procedure you can even do with the scan and initially compute total_time via:
select .... function(start,end) as total_time....
Bye, Olaf.