Skip to main content

mes.spGetOEEDataByIntervalByShift

Description

Calculates Overall Equipment Effectiveness (OEE) metrics for a given asset across shifts, aligned to time-based intervals (Hour, Day, or Week). Aggregates runtime, downtime, and counter metrics using shift windows. Ideal for tracking OEE by operational shifts.

Syntax

mes.spGetOEEDataByIntervalByShift @assetId, @startDate, @endDate, @interval

Parameters:
@assetId (int): Asset ID to analyze.
@startDate, @endDate (datetime): Time range for calculation.
@interval (varchar): Interval granularity. One of 'Hour', 'Day', or 'Week'.

Returns:
List of shift-level rows with:
- Shift ID, name, asset and item metadata
- Duration, runtime, planned and unplanned downtime
- Counter-based performance and quality
- Computed OEE KPIs (availability, performance, quality, oee)

Code Example

EXEC mes.spGetOEEDataByIntervalByShift
@assetId = 1024,
@startDate = '2025-07-01',
@endDate = '2025-07-07',
@interval = 'Day';