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

RetiredCommented:
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
``````
0
CIOCommented:
If your values are decimals, a one-liner will do:

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

/gustav
0
Commented:
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

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

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

/gustav
0
RetiredCommented:
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
Older 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.