Sorry I could not think of a better title.
I have a table:
... DATE (datetime) project (number - this is an FK for the project table) FROM (datetime) TO (datetime) )) ...
And I have to choose the minimum value for each day (as the time of starting a workday), the largest value (as the working day Ends) and for a project marked as "BREAK", one to two, therefore the output will look like this:
Time to spend To spend time with breaks from 1.1.2011 9:00 17:00 12:00 13:00 7.0
Is it possible to have a selection in any way? So far I have this: "TO" (MAX ("TO_X") - "FROM", MAX ("TO_X"
) as MIN ("FROM_X") It takes care of the start and end of the work day, but I do not know how to include the break thing.
If the "brake" project appears only once every day, you can use it: "TO" MAX ("TO_X") as "TO", max (the case when the project SELECT MIN ("FROM_X") SELECT MIN ("FROM_X") "," FROM "BREAK FROM" and "FROM_X" as a "break" "TO", (MAX ("TO_X") - MIN ("FROM_X")) * 24 AAS Time_SPENT, "DAY" by DATA, "AT" by ATTENDANCE_HOURS GROUP "DAY" DAY ("Project" = "Break" to Two_X Other Null End)
If not, you have to choose the right consolidated work. You can also use it to exclude your "brake" project from the first two columns:
SELECT MAX (when the project
Comments
Post a Comment