Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 To: Stewart Chew
  Where is Stewart Chew?
 
 Malaysia
 Stewart Chew
 Tags
Subject: RE: hours conversion
Thread ID: 143367 Message ID: 143368 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Tuesday, August 28, 2007 11:03:08 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
Stewart

Try

strtran(str(int(tm_set/60),2)+':'+ str(tm_set % 60,2),' ','0')

Your tm_set has decimals in it. This function ignores the decimal.

Regards
Tushar

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