matrix2021
ВЫБРАННЫЙ ПЕРИОД: ГОД — МЕСЯЦ — DECLARE @end DATE = ‘1..’
SELECT SN , LogicalName
FROM RW_ReceivedData
INNER JOIN dm_Devices
ON RW_ReceivedData.DeviceId=dm_Devices.Id
WHERE SN=» and Time between ’01..’
and DATEADD(M,DATEDIFF(M,0,@end)+1,0) and LogicalName=0x01000F0801FF and DATEPART(HOUR,Time)=00
order by Time asc