Convert 0,90 into 1 hour 30 min in MS ACCESS

Hi, I need to convert 0,90 into 1 hour 30 min or
1,90 to 2 hour 30 min.
danpinoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GrahamSkanRetiredCommented:
With VBA:

Sub CallStringToTime()
    Dim strTimeString As String
    strTimeString = "1,90"
    MsgBox StringToTime(strTimeString)
End Sub

Function StringToTime(strTimeString As String) As Date
    Dim strTimeParts() As String
    
    strTimeParts = Split(strTimeString, ",")
    StringToTime = TimeSerial(strTimeParts(0), strTimeParts(1), 0)
End Function

Open in new window

0
Gustav BrockCIOCommented:
If your values are decimals, a one-liner will do:

datHours = TimeSerial(Int(t), (t - Int(t)) * 100, 0)

/gustav
0
IrogSintaCommented:
ConvTime: Format(TimeSerial(Val([tm]), Mid([tm], InStr([tm], ",") + 1), 0), "h \hr mm \m\i\n")

The above will convert 1,90 to give you 2 hr 30 min
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Gustav BrockCIOCommented:
I still believe 0,90 and 1,90 represent decimal numbers, thus should be treated as so.

/gustav
0
GrahamSkanRetiredCommented:
cactus_data,

Yes, that's interesting. But if the asker has continental settings so that 1,90 is the same as decimal 1.9 hours, then it would convert to 1 hour and 54 minutes, which is not what the asker expects.
0
Martin LissOlder than dirtCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.