FYI - I'm using DB2 v.7 as my RDBMS
I am building a scheduling system for employees. I have a table that houses "placeholders" for every 15 minute increment of the day. I need to find a creative solution for resolving the a particular day down to single events. Sound easy? OK, here's the challenge.. my records look (dumbed down) like this:
EVENT -- STARTTIME -- ENDTIME
-------------------------------
dual -- 9:00:00AM -- 9:15:00AM
dual -- 9:15:00AM -- 9:30:00AM
dual -- 9:30:00AM -- 10:00:00AM
lunch -- 10:00:00AM -- 10:15:00AM
lunch -- 10:15:00AM -- 10:30:00AM
lunch -- 10:30:00AM -- 11:00:00AM
dual -- 11:00:00AM -- 11:15:00AM
dual -- 11:30:00AM -- 11:45:00AM
meeting -- 12:00:00PM -- 12:15:00PM
meeting -- 12:15:00PM -- 12:30:00PM
... you get the point...
Somehow, i have to group those records so that i have a distinct, yet not fully distinct event to pull the min(start) and max(end) times for each... to look like this:
EVENT -- STARTTIME -- ENDTIME
-------------------------------
dual -- 9:00:00AM -- 10:00:00AM
lunch -- 10:00:00AM -- 11:00:00AM
dual -- 11:00:00AM -- 11:45:00AM
meeting -- 12:00:00PM -- 12:30:00PM
While this seems like a simple task,, it really is not.. as a matter of fact, quite frustrating.. . Can someone PLEASE help me with a solution to this problem? Seems like someone has to have been in this boat before..
Thank YOU!!
I am building a scheduling system for employees. I have a table that houses "placeholders" for every 15 minute increment of the day. I need to find a creative solution for resolving the a particular day down to single events. Sound easy? OK, here's the challenge.. my records look (dumbed down) like this:
EVENT -- STARTTIME -- ENDTIME
-------------------------------
dual -- 9:00:00AM -- 9:15:00AM
dual -- 9:15:00AM -- 9:30:00AM
dual -- 9:30:00AM -- 10:00:00AM
lunch -- 10:00:00AM -- 10:15:00AM
lunch -- 10:15:00AM -- 10:30:00AM
lunch -- 10:30:00AM -- 11:00:00AM
dual -- 11:00:00AM -- 11:15:00AM
dual -- 11:30:00AM -- 11:45:00AM
meeting -- 12:00:00PM -- 12:15:00PM
meeting -- 12:15:00PM -- 12:30:00PM
... you get the point...
Somehow, i have to group those records so that i have a distinct, yet not fully distinct event to pull the min(start) and max(end) times for each... to look like this:
EVENT -- STARTTIME -- ENDTIME
-------------------------------
dual -- 9:00:00AM -- 10:00:00AM
lunch -- 10:00:00AM -- 11:00:00AM
dual -- 11:00:00AM -- 11:45:00AM
meeting -- 12:00:00PM -- 12:30:00PM
While this seems like a simple task,, it really is not.. as a matter of fact, quite frustrating.. . Can someone PLEASE help me with a solution to this problem? Seems like someone has to have been in this boat before..
Thank YOU!!