alca1 Posted January 31, 2018 Share Posted January 31, 2018 I have a db table that is logging tasks. Events are grouped and have a timestamp: like this for examplegroupidtaskTypetimestamp1start10:001pauseOn10:301pauseOff10:351pauseOn10:551pauseOff11:001end11:30 I need to create a report for total time required to perform tasks, subtracting the "pause" time...What is the best way to achieve this? Maybe the db must be modified a little to create easily the reports?Or there are some trick or formulas to create such a report? Link to comment Share on other sites More sharing options...
sergey.vishnevetskiy Posted January 31, 2018 Share Posted January 31, 2018 Will be helpful to know what db you're using as datasource? In general it's easier to use db query advantages. Link to comment Share on other sites More sharing options...
alca1 Posted January 31, 2018 Author Share Posted January 31, 2018 I use mySQL. Do you mean than that the problem must be solved through SQL? Link to comment Share on other sites More sharing options...
sergey.vishnevetskiy Posted January 31, 2018 Share Posted January 31, 2018 Yes, exactly. I'm have no deep knowledge of mySQL, but here we'll need one subquery and sum I think. Link to comment Share on other sites More sharing options...
sergey.vishnevetskiy Posted January 31, 2018 Share Posted January 31, 2018 Or you can mark start with minus, end with plus, pauseOn with plus, pauseOff with minus and just sum them all. You'll have clean time then. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now