Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Totalling time
Message
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Miscellaneous
Thread ID:
00898230
Message ID:
00898236
Views:
11
>I have a character field that contains spans of time: 4hours, 22 minutes, 11 seconds would appear as 04:22:11. My report lists all the time spans now, how do I get a total? Thanks a lot,
>
If you're using a query as a source of report, add one more column with time converted to seconds. After that you can sum seconds in the report varable and convert it back into hh:mm:ss format.
SELECT ..., timefield, 
   CTOT(timefield) - DTOT(TTOD(CTOT(timefield)))) AS timeseconds ;
....
* Convert back to the hh:mm:ss format in the report
PADL(INT(rnTotalSec/3600), 2, "0") + ":" + ;
		PADL(INT((rnTotalSec%3600)/60),2, "0") + ":" + ;
		PADL(rnTotalSec % 60,2, "0") 
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform