# mes.spGetAssetPerformanceEventByShift

## Description
Combines data from production events and performance events to return summarized performance information for each shift, including target counts, runtime, coded loss minutes, and performance metrics.

## Syntax
<b>mes.spGetAssetPerformanceEventByShift @assetPath, @rangeStart, @rangeEnd</b>  
<br /><br />

<b>Parameters:</b><br />
@assetPath (varchar): Asset path string (supports LIKE match)<br />
@rangeStart (datetime): Start of the query range<br />
@rangeEnd (datetime): End of the query range<br /><br />

<b>Returns:</b><br />
Result set including shift-level performance metrics such as runtime, performance %, infeed rate, target count, and coded loss minutes.

### Code Example

```sql
-- Get asset performance by shift between two dates
EXEC mes.spGetAssetPerformanceEventByShift
  @assetPath = 'Site1\Line1%',
  @rangeStart = '2025-07-01',
  @rangeEnd = '2025-07-30';
```
