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


> >
> >
> > 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 :(

nhour=0
scan 
  nhour=nhour+val(substr(tablename.lastcolumn,1,2)+val(substr(tablename.lastcolumn,4,2)) / 60  && or without dividing with 60 ??
endscan   && I can't guess if you have to present them in just hours + fraction or hours + minutes

.CMIIW whereever, that's just the idea

.

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