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


> > 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.

Thanks.

Can i know what is the '%' means? Why we want to use '%'?

Regards,

Stewart Chew

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