WorkSync Evening Shifts Only Report
This specialized version of the WorkSync V3 report focuses exclusively on evening shift schedules (14:00-18:59). It provides a detailed view of afternoon/evening staffing without the complexity of day and night shift data.
Parameters
@MIN- Start date for the report (example: '9/1/2022')@MAX- End date for the report (example: '9/1/2022')
Data Components
The report consists of 1 focused data section:
- Evening Shifts Only - Covers shifts from 14:00:00 to 18:59:00
Features include:
- Scheduled employees for evening shifts
- Open evening shifts from unfulfilled schedules
- Zone-based organization for evening coverage
- Position details for evening shift staff
Output Format
Simplified single-shift format focusing on evening operations:
| Zone | Employee Name | Position | Shift Time |
|---|---|---|---|
| Zone Name | Employee Name | Position Title | Start - End Time |
| OPEN SHIFT | Position Title | Start - End Time |
Technical Implementation
The script uses:
- Single shift time filtering (14:00:00 to 18:59:00)
- Simplified CTE structure focusing on evening shifts only
- Zone-based organization using Work Group 5
- Standard WorkSync V3 zone filtering with
@WESTBloomtable - Reduced complexity compared to full three-shift reports
Zone Coverage
- Same zone configuration as WorkSync V3
- Zone numbers: 2, 4, 5, 6, 7, 12, 29
- Focused on evening shift staffing patterns
Use Cases
- Afternoon Operations Planning - Focus on evening shift staffing
- Evening Shift Management - Simplified view for evening supervisors
- Shift Change Reports - Overview of evening coverage during transitions
- Evening Shift Open Position Tracking - Identify afternoon staffing gaps
- Simplified Reporting - When day/night data isn't needed
Benefits
- Reduced Complexity - Easier to read and understand
- Faster Processing - Less data to process and display
- Focused Analysis - Concentrate on evening shift patterns
- Simplified Distribution - Easier to share with evening shift staff
- Quick Reference - Fast overview of afternoon operations
Shift Transition Planning
This report is particularly useful for:
- Planning day-to-evening shift handoffs
- Ensuring adequate evening coverage
- Identifying evening-specific staffing needs
- Managing afternoon peak activity periods
Related Reports
T-SQL
SET NOCOUNT ON
SET ANSI_WARNINGS OFF
DECLARE @MIN DATE, @MAX DATE, @ZoneCount int, @Row int
DECLARE @Temp Table (Zone varchar(30),empname Varchar (60), position varchar(30), Shifttime varchar(20),RowOrder Int)
DECLARE @WESTBloom Table(Num smallint)
DECLARE @POSITIONS Table(Num Smallint)
insert into @WESTBloom(Num) Values (1),(2),(4),(5),(6),(7),(12),(29)
insert into @POSITIONS(Num) Values (90),(107),(113),(139),(166),(167),(185)
/*
SET @MIN={mindate}
SET @MAX={maxdate}
*/
SET @MIN='11/17/2022'
SET @MAX='11/17/2022'
Set @Row = 1
;
Select @ZoneCount = COUNT(*) from WORKGROUP5 w5 where w5.WGNUM in (Select num from @WESTBloom)
Insert Into @Temp Select Null,'EVENINGS',NULL,NULL,0
While @Row<=@ZoneCount
Begin
WITH Zones as (
Select w5.WGNUM, Case
When w5.WGNUM = 1 then SUBSTRING(w5.NAME,2,30)
Else SubString(w5.NAME,6,30)
End as NAME,
ROW_NUMBER() Over (Order by Case
When w5.WGNUM = 1 then SUBSTRING(w5.NAME,2,30)
Else SubString(w5.NAME,6,30)
End) as Rownum
from WORKGROUP5 w5 where w5.WGNUM in (Select num from @WESTBloom)
),
Evenings as (
select t.wg5num,Case when t.wg5num=1 then SUBSTRING(t.wg5,2,30) else Substring(t.wg5,6,30) end as Zone, t.wg3 as Position,t.schdate as schdate,t.shifttime as shifttime,t.empname as empname,row_number() over (order by t.wg5, t.wg3) as numero
from
(
select distinct wg5.WGNUM as wg5num, wg5.NAME as wg5, wg3.NAME as wg3,
sch.schdate as schdate,
Right(convert(varchar(20),sch.starttime,100),7)+' - '+ Right(convert(varchar(20),sch.endtime,100),7) as shifttime,
e.firstname+' '+e.lastname as empname
from schedules sch
inner join employees e
on e.filekey = sch.filekey
inner join WORKGROUP5 wg5
on wg5.WGNUM = sch.WG5
inner join workgroup3 wg3
on wg3.wgnum = sch.wg3
where convert(time,sch.starttime) between '14:00:00' and '18:59:00'
and sch.schdate between @min and @max
and sch.wg1 = 9
and sch.wg3 in (select num from @POSITIONS)
and sch.WG5 in (select num from @WESTBloom)
and sch.schtype in (0)
union all
select distinct wg5.WGNUM as wg5num, wg5.NAME as wg5, wg3.NAME as wg3,
sch.schdate as schdate,
Right(convert(varchar(20),sch.mindate,100),7)+' - '+ Right(convert(varchar(20),sch.maxdate,100),7) as shifttime,
'OPEN SHIFT' as empname
from unfulfilledschs sch
inner join WORKGROUP5 wg5
on wg5.WGNUM = sch.WG5
inner join workgroup3 wg3
on wg3.wgnum = sch.wg3
where convert(time,sch.mindate) between '14:00:00' and '18:59:00'
and sch.schdate between @min and @max
and sch.wg1 = 9
and sch.wg3 in (select num from @POSITIONS)
and sch.WG5 in (select num from @WESTBloom)
and sch.schtype in (0)
)t
)
Insert Into @Temp
Select z.NAME,Null,Null,Null,@Row from Zones z where z.Rownum=@Row
UNION
Select 'zzz',e.empname,e.Position,e.shifttime,@Row
From Evenings e
where e.wg5num = (Select z.WGNUM from Zones z where z.Rownum=@Row)
Set @Row = @Row+1
End
Select * from @Temp order by 5,1,3Content Inventory
- Doc File:
content/docs/reports/worksync/worksync_evening_shifts_only.mdx - SQL Script:
SQL/reports/worksync/riverview_version_of_worksync_sechedule_report.sql