Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 To: Stewart Chew
  Where is Stewart Chew?
 
 Malaysia
 Stewart Chew
 Tags
Subject: RE: hours conversion
Thread ID: 143367 Message ID: 143369 # Views: 1 # Ratings: 1
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Tuesday, August 28, 2007 11:07:44 AM         
   


> Dear Expert,
>
> Can anyone here help me to solve this problem? I want to do conversation from numeric to hours.
> For example :-
>
> Field :
> tm_set N(6,2)
>
> tm_set
> 125.00
> 55.00
> 120.00
>
> How m i convert the above value to hh:mm by using SELECT OR UPDATE command?
> 125.00 = 02:05
> 55.00 = 00:55
> 120.00 = 02:00
>
> Regards,
>
> Stewart Chew

SELECT MinToHours(tm_set) AS MyHours
.....



FUNCTION MinToHours(lnMinutes)
 LOCAL lnHours, lnMin
 lnHours = INT(lnMinutes/60)
 lnMin   = lnMinutes % 60
RETURN PADL(TRANSFORM(lnHours),2,[0])+[:]+;
       PADL(TRANSFORM(lnMin),2,[0])





-----------------
Borislav Borissov

Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.

ENTIRE THREAD

hours conversion Posted by Stewart Chew @ 8/28/2007 10:48:18 AM
RE: hours conversion Posted by tushar @ 8/28/2007 11:03:08 AM
RE: hours conversion Posted by Borislav Borissov @ 8/28/2007 11:07:44 AM
RE: hours conversion Posted by Stewart Chew @ 8/28/2007 12:01:35 PM
RE: hours conversion Posted by Borislav Borissov @ 8/28/2007 12:08:51 PM
RE: hours conversion Posted by Cetin Basoz @ 8/28/2007 2:20:09 PM
RE: hours conversion Posted by Boudewijn Lutgerink @ 8/31/2007 11:28:53 AM