Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Shaheryar Rashed
  Where is Shaheryar Rashed?
 Multan
 Pakistan
 Shaheryar Rashed
 To: David Mustakim
  Where is David Mustakim?
 Jakarta
 Indonesia
 David Mustakim
 Tags
Subject: RE: time totals
Thread ID: 395497 Message ID: 395501 # Views: 48 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Wednesday, January 15, 2014 2:30:23 PM         
   


> > Hi experts!
> >
> > below is data:
> >
> >
Create Cursor test ( ariv c(10), dis c(10) )
> > Insert into test values ('08:00a', '08:30p')
> > Insert into test values ('08:00a', '09:40p')
> > Insert into test values ('08:00a', '10:45p')
> > 
> > Browse fields ariv, dis, labour = Transform( Right( Ttoc( Ctot(dis) - ( Ctot(ariv) - Ctot('0')), 1 ), 6), '@R 99:99' )
> > LOCAL lcVal
> > SUM val(Transform( Right( Ttoc( Ctot(dis) - ( Ctot(ariv) - Ctot('0')), 1 ), 6), '@R 99:99' ) ) TO lcVal
> > WAIT WINDOW lcVal
> > 

> >
> > now i have to total the time... guide me please
>
>
> Actually your last 3 lines DID IT ALREADY. Maybe if you change the variable name from lcVal to lnVal then you can see it more clearly.
>
> But I'd prefer if somehow you use datetime values for all your fields, then total the time differences (which would be in seconds) then present the total value after converting them from total seconds to hours plus modulus minutes part, or hour fraction. I assume you do know how to do the conversion.
>
> What I'm saying is your fields data type should be all datetime - NOT characters - so that it is much easier to do math on
>
> David
it calculates but rounds the result
and if i change fields to datetime, i should change all the project :(

ENTIRE THREAD

time totals Posted by Shaheryar Rashed @ 1/15/2014 1:58:56 PM
RE: time totals Posted by David Mustakim @ 1/15/2014 2:18:45 PM
RE: time totals Posted by Shaheryar Rashed @ 1/15/2014 2:30:23 PM
RE: time totals Posted by David Mustakim @ 1/15/2014 2:47:42 PM
RE: time totals Posted by Shaheryar Rashed @ 1/15/2014 3:13:41 PM
RE: time totals Posted by Tore Bleken @ 1/15/2014 3:22:29 PM
RE: time totals Posted by Shaheryar Rashed @ 1/16/2014 7:36:37 AM
RE: time totals Posted by Anders Altberg @ 1/15/2014 4:51:39 PM
RE: time totals Posted by Cetin Basoz @ 1/15/2014 5:51:36 PM
RE: time totals Posted by Shaheryar Rashed @ 1/17/2014 6:51:16 AM
RE: time totals Posted by Cetin Basoz @ 1/17/2014 1:24:20 PM
RE: time totals Posted by Shaheryar Rashed @ 1/18/2014 6:45:09 AM
RE: time totals Posted by Anders Altberg @ 1/18/2014 11:50:19 PM