|
tech
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Time ConversionIf you have work 1 hour 30 Minutes
How do you convert it to 1.50 And viceversa 1.50 to 1h 30m Thank you all, Bre-x I don't recall a built-in function in Access that does this.
You might be able to find (search on-line) a function that takes a text string (e.g., "1 hour 30 minutes") and parses it into 1.5 hours. If not, you'd need to create a procedure to do this ... assuming you start with a single text string. If you have two number fields, one for hours, one for minutes, you could use a query to add two numbers together, one the hours and the other, the minutes divided by 60 (which gives you fractional hours -- 30/60 = .5). "How" will depend on "what" -- "what" do you have? Regards Jeff Boyce Microsoft Office/Access MVP Show quoteHide quote "Bre-x" <cholot***@hotmail.com> wrote in message news:ukgFpcy$JHA.4984@TK2MSFTNGP05.phx.gbl... > If you have work 1 hour 30 Minutes > > How do you convert it to 1.50 > > And viceversa 1.50 to 1h 30m > > Thank you all, > > Bre-x > > Debug.Print CDbl(#01:30#)*24 = 1.5
Debug.Print CDbl([TheTime])*24 = 1.5 The above works if the hours are in a Date/Time field. Debug.Print CDate(1.5*4.16666666666666E-02) = 1:30:00 AM -- Show quoteHide quoteJerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "Bre-x" wrote: > If you have work 1 hour 30 Minutes > > How do you convert it to 1.50 > > And viceversa 1.50 to 1h 30m > > Thank you all, > > Bre-x > > > 1:30 is store on a date/time field
1.50 is store on a number field (Double) thank you!!! Show quoteHide quote "Bre-x" <cholot***@hotmail.com> wrote in message news:ukgFpcy$JHA.4984@TK2MSFTNGP05.phx.gbl... > If you have work 1 hour 30 Minutes > > How do you convert it to 1.50 > > And viceversa 1.50 to 1h 30m > > Thank you all, > > Bre-x > > 1:30 in a date/time field is a "point-in-time", not a duration.
You can store what looks like a 'duration' in a date/time field, but it won't behave like one. For example, once you go past 24 hours, you start over at 00:00 again! Good luck! Regards Jeff Boyce Microsoft Office/Access MVP Show quoteHide quote "Bre-x" <cholot***@hotmail.com> wrote in message news:OGy0%23sz$JHA.1376@TK2MSFTNGP02.phx.gbl... > 1:30 is store on a date/time field > 1.50 is store on a number field (Double) > > thank you!!! > > > "Bre-x" <cholot***@hotmail.com> wrote in message > news:ukgFpcy$JHA.4984@TK2MSFTNGP05.phx.gbl... >> If you have work 1 hour 30 Minutes >> >> How do you convert it to 1.50 >> >> And viceversa 1.50 to 1h 30m >> >> Thank you all, >> >> Bre-x >> >> > >
Divide One Field into 3 parts
Linking form information to specific tables repeat information in report (Access 2007) Report - how to print each page to new document. Conditional formatting based on the Row Source in another control. relationships Auto populate month & year How do i dicount a field in access like cost? IIf Statement used for Counting Deletion of a text file fails |
|||||||||||||||||||||||