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: 143373 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Tuesday, August 28, 2007 12:08:51 PM         
   


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


[%] is a modulus operator. There is a function named MOD() in VFP also.
That operator gives you the remainder of the division:

? INT(125 / 60) && -> 2
? 125 % 60      && -> 5 (2*60 + 5)

Check in HELP under MOD() topic for better explanation.

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