Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sum hours
Message
From
27/06/2005 04:36:56
 
 
To
27/06/2005 04:32:13
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01026630
Message ID:
01026631
Views:
20
>hi all,
>i try to sum this hours and minuts via this code under , it sum hours ok,
>somthing rong with minuts
>ex:34:20+36:40+71:10+66:10 the result must be 208:20
>
>via this code under i get 208:44
>
> SUM VAL(LEFT(m1_m,8))*3600 + ;
>            VAL(SUBSTR(m1_m,6,2))*30 + ;
>            VAL(RIGHT(m1_m,2)) TO lnSec
>          m.dae= PADL(INT(lnSec/3600), 6, "0") + ":" + ;
>                 PADL(INT((lnSec%3600)/60),2, "0")
>
>thanks.

I see a typo in your formula, change 30 to 60! 60 is for 60 minutes in an hour, 30 means nothing.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform