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: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 Tags
Subject: RE: time totals
Thread ID: 395497 Message ID: 395681 # Views: 43 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Friday, January 17, 2014 6:51:16 AM         
   


> > 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
>
> I thought I gave you the solution last week:
>
> 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')
> 
> Select Sum( Ctot(dis) - ( Ctot(ariv) - Ctot('0') ) - Ctot('0') ) from test into array laTotalTime
> 
> Local hrs, mins
> hrs = Int(laTotalTime[1]/(60*60))
> mins = Int(laTotalTime[1]%(60*60)/60)
> 
> ? Textmerge('<< m.hrs >>:<< Padl(m.mins,2,"0") >>')

>
>

> Cetin Basoz
>
> Give some sample data in code for your question - here is the tool you need to generate the code
>
> My Blog
>

> MongoDb Certified Developer
> MongoDb Certified DBA
>

> Support Wikipedia

Sir Cetin!

superb solution. 1 more request, i want to learn more about ctot() function for that in future i fully approach about how to multiply, devide and any other formula myself. guide me where i can find ctot() and ttoc() function's details. bcz vfp help dont contain (as i searched) too much information about these functions

Regards, and many many thanks to help

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