How to determine the time 'amount' between two times?

Hi,

I have a table which contains time management data. We have:

R = Registration
A = Arrival
D = Departure

Time information for A and D can be in the table multiple times for one of our employees. What I would like to do is show the amount of time between the R and the last D of the day.

So R = 08:00 and the last D = 18:30 so the time amount would be 10 hours and 30 minutes.

Is there any way to do this in MySQL?

Regards

Ken
kenuk110Asked:
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.

fcardinauxCommented:
You may use the timediff() function:

SELECT MAX(TIMEDIFF(D, R)) FROM thetable WHERE condition

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timediff
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
kenuk110Author Commented:
Worked perfectly.

Thank you.
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
MySQL Server

From novice to tech pro — start learning today.