Home All Groups Group Topic Archive Search About
Author
7 Jul 2009 5:19 PM
Bre-x
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

Author
7 Jul 2009 7:24 PM
Jeff Boyce
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
>
>
Are all your drivers up to date? click for free checkup

Author
7 Jul 2009 7:28 PM
Jerry Whittle
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
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Show quoteHide quote
"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
>
>
>
Author
7 Jul 2009 7:43 PM
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
>
>
Author
7 Jul 2009 7:52 PM
Jeff Boyce
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
>>
>>
>
>

Bookmark and Share