troubleshooting Question

SQL Conversion Time to Decimal

Avatar of APD Toronto
APD TorontoFlag for Canada asked on
Microsoft AccessVisual Basic ClassicSQL
2 Comments2 Solutions319 ViewsLast Modified:
Hello Experts,

I have a time field, set to Date/Time with input mask 00:00;0;_

The field accepts values like 8:48, 10:45 and 16:11 and I'm wondering if i can convert these do decimal using a SQL Query?

for example, if i were using vb to convert i would use the folwing logic:

hr = anything before the colon
min = anything after the ccolon

result = hr + (min / 60)
'
so 8:48 = 8.8
   10:45 = 10.75
   16:11 = 16.18333

Is this possible in SQL Query?

Thank you.
ASKER CERTIFIED SOLUTION
dqmq

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros