Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculate time total
Message
 
To
11/06/2001 18:47:14
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00518132
Message ID:
00518175
Views:
14
Get total time for each name in seconds:
select cname, ;
       sum(3600*val(subs(ctime,1,2)) + ;
           60*val(subs(ctime,4,2)) + ;
           val(subs(ctime,7,2))) as nsec ;
   from theFile ;
   group by cname ;
   into cursor q1
Get time formated as the original string:
select cname, ;
       nsec, ;
       str(int(nsec/3600),3) + ':' + ;
           str(int(mod(nsec,3600)/60),2) + "'" + ;
           str(mod(nsec,60),2) as ctime ;
   from q1 ;
   into cursor q2
Get time formated as hours, min, sec:
select cname, ;
       nsec, ;
       int(nsec/3600) as nhours, ;
       int((mod(nsec,3600)/60)) as nmin, ;
       int(mod(nsec,60)) as ctime ;
   from q1 ;
   into cursor q2
Doru
Previous
Reply
Map
View

Click here to load this message in the networking platform