Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Sum of Time MySQL (clock in / out)
Old 02-13-2012, 09:41 PM Sum of Time MySQL (clock in / out)
Red_X_'s Avatar
Extreme Talker

Posts: 158
Location: Houston
Trades: 0
I have a table layed out for clocking in and out of a support ticket.

Currently the user will select if they are clocking in or out, and when they do it updates / adds a row for that user.

Now what I would like to do is add up the time taken for each of these tickets.

If bob clocks in at 9am and then finishes his work on it at 5pm. But then on the next day, jim clocks into the ticket and starts at 5am and goes to 10am. Which would be a total of what 13 hours on a support ticket.

So I guess my question is this

Is there a way to run a single query to get the number I need? Or am I going to extract each record and do it with a loop?

Thanks,

X
__________________
"Good News Everyone, by reading this your hearing my voice."

Last edited by Red_X_; 02-13-2012 at 09:43 PM..
Red_X_ is offline
Reply With Quote
View Public Profile Visit Red_X_'s homepage!
 
 
Register now for full access!
Old 02-16-2012, 05:29 AM Re: Sum of Time MySQL (clock in / out)
Skilled Talker

Posts: 69
Trades: 0
I've not done anything like that, but this may help.

http://www.sqlteam.com/article/worki...-in-sql-server
HullBorn is offline
Reply With Quote
View Public Profile
 
Old 02-16-2012, 05:52 PM Re: Sum of Time MySQL (clock in / out)
chrishirst's Avatar
Defies a Status

Posts: 44,046
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
http://dev.mysql.com/doc/refman/5.5/...functions.html
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Sum of Time MySQL (clock in / out)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18807 seconds with 11 queries