Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Creating a 2nd Schedule Table

Author  Topic 

marshymell0
Starting Member

2 Posts

Posted - 2014-12-17 : 12:09:32
Hi,

I have a table right now, that gives when an event was done in a date time (eg. Event done Jan 1, 2014, event 2 done Jan 2, 2014).

What is a feasible way to make a second table to join on this date time which provides the type of worker (eg. part time, full time, volumteer, etc) without making a table with every day, hour and minute as a separate row?

For example, a test was done on Jan 1, 2014 at 1pm, in table A. I was thinking my second table would list every date and time and fill in what type of worker was on at that minute/time. Then I would left outer join with my first table, so the end result would be Event A was done Jan 1, 1pm, therefore it was a: Volunteer worker. Event B was done Jan 1, 2pm, therefore it was a : Full time worker.

But I realize that it is not feasible to write a table with every date/time available to accommodate all the different types of shifts.

mandm
Posting Yak Master

120 Posts

Posted - 2014-12-17 : 13:41:59
Is it possible to have more than one worker type per event?
Go to Top of Page

marshymell0
Starting Member

2 Posts

Posted - 2014-12-18 : 17:10:02
Sorry I used the volunteer, full time as an example, but really we are tracking a type of shift.

A person can only be a type of worker in one day/time, but that same person can be a different type of worker on another day.
So for example, Today I am given the Type A shift worker, everybody else will be labelled type B worker. Tomorrow, I can be be a type B worker, and someone else will be type A. There can only be this one special Type A worker in a day though, everybody else is a Type B (they are actually sub types within type B but I can keep it more simple with having just the two types). An event cannot have both a type A and a type B worker doing it.

I have talked with our scheduler and they said they would be willing to fill in an excel "spreadsheet" of which worker is type A and type B but I couldn't think of a way to organize such a table.

Basically we want to track the count/percent of events done by the Type A versus the Type B worker by the different hours of the day.
Go to Top of Page
   

- Advertisement -