Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: Shaheryar Rashed
  Where is Shaheryar Rashed?
 Multan
 Pakistan
 Shaheryar Rashed
 Tags
Subject: RE: time totals
Thread ID: 395497 Message ID: 395775 # Views: 24 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Saturday, January 18, 2014 11:50:19 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


When you sum time worked for more than one day and use VFP date mathematics that basically sum seconds worked and then adds that to some date and the sum adds up to more than 24 hours then one day is added for each 24-hour period, even if actually, as is most likely, worked on many more than one single day. What you need to calculate would likely be a
SELECT employee, COUNT(DISTINCT date), SUM(dis-ariv) ...
to be able distinguish normal worktime a
-Anders

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