Forum Moderators: coopster
I have a page that lists all the work and shows total time spent
The log table looks like :
logID ¦ jobID ¦ type ¦ start ¦ end ¦ total
1 23 T 9:00 10:00 1:00
2 23 P 10:00 12:00 2:00
If I GROUP BY jobID it will just bring back 1 row, I cant find anything on clever GROUP statments except something about rollup
I was looping through everything but that has its own problems.
*note - yes I know it wont add 2:00 (its VARCHAR at the mo, I would probably change to DECIMAL)
Is there another approach to this?
I could have taskID=34(in tasks table) and projectID=34 (in projects table)
In the log table it would be jobID=34 and type='T' (for task) jobID=34 and type='P' (for project)
just grouping jobID would sum the 2 jobID 34 jobs as one!
something like sum(jobID) where type='p' would be nice :)