March 1, 2016 at 9:52 am
I need help writing a script to populate a table with shift times (start date and time and end date and time for each shift from now to future date - ie 15 years from now.) that have a varying pattern as described below.
Table Definition
Shift - varchar(10)
BeginDatetime - datetime
EndDatetime -datetime
Shift 1 8:00- 20:00
Shift 2 20:00 - 8:00
Shift 3 8:00 - 20:00
Shift 4 20:00 - 8:00
repeating Pattern
1, 2, 3, 4, 3, 4, 1, 2, 1, 2, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 3, 4, 3, 4, 3, 4
March 1, 2016 at 10:09 am
Why don't you store the pattern in a different table so you can just replicate it any times you need?
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply