| Table: Staff_Target_Range_Day | |||
| Holds the target working hours for each day of the week that applies during the date range in Staff_Target_Range. NOTE: primary key is non-standard, standard key column is a unique constraint for performance issues. | |||
| Columns | |||
| Name | Type | Constraints | Description |
| staff_target_range_day_KEY | int | NOT NULL | Assigned by COMMON_dp_Allocate_Unique_Identifiers. Manufactured key for this table. |
| staff_target_range_KEY | int | NOT NULL | Links this record to the Staff_Target_Range record is is for. |
| week_day | tinyint (3) | NOT NULL | This is the day of the week as a number between 1 and 7 where the week starts on Monday. Monday = 1, Tuesday = 2, ..., Saturday = 6, Sunday = 7. The expression to convert this value [based on @@DATEFIRST == 1] to the current @@DATEFIRST setting is: [week_day] = (((DATEPART(WEEKDAY, GETDATE()) - 1) + (@@DATEFIRST - 1)) % 7) + 1 |
| target_hours | decimal (4, 2) | The number of hours expected to be worked on this day of the week. The value must be between 0.00 and 24.00. | |
| Primary key | |||
| Name | Columns | Description | |
| PK_Staff_Target_Range_Day$staff_target_range_KEY$week_day | staff_target_range_KEY, week_day | CLUSTERED | |
| Unique constraints | |||
| Name | Columns | Description | |
| UK_Staff_Target_Range_Day__staff_target_range_day_KEY | staff_target_range_day_KEY | Backward compatible table key must be unique (instead of being a primary key as it normally is.) | |
| Foreign keys | |||
| Name | Columns | Referenced table | Description |
| FK_Staff_Target_Range_Day__Staff_Target_Range__staff_target_range_KEY | staff_target_range_KEY | Staff_Target_Range | |