Hello, I am trying to build an output that takes data from a table in the following format and pivots the unit column while summing each chunk of time by the Time_2 Field, for each hour of each day.
For example see test table below.
The sum of Units field 0.071+0.083+0.072+0.062 for Time_2 for hour 2 is 0.291
The output I am trying to get is with columns going up to 24:00 with the final column summing all the values for that day.
Some Sample data below.
USE [DBNAME HERE]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[test_rr_data](
[ID] [numeric](18, 0) NULL,
[UNIT] [real] NULL,
[Time_1] [datetime] NULL,
[Time_2] [datetime] NULL,
[Time_3] [datetime] NULL
) ON [PRIMARY]
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T11:45:00.000' AS DateTime), CAST(N'2023-03-03T12:00:00.000' AS DateTime), CAST(N'2023-03-03T12:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T12:00:00.000' AS DateTime), CAST(N'2023-03-03T12:00:00.000' AS DateTime), CAST(N'2023-03-03T12:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T12:15:00.000' AS DateTime), CAST(N'2023-03-03T14:00:00.000' AS DateTime), CAST(N'2023-03-03T14:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T12:30:00.000' AS DateTime), CAST(N'2023-03-03T14:00:00.000' AS DateTime), CAST(N'2023-03-03T14:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T12:45:00.000' AS DateTime), CAST(N'2023-03-03T14:00:00.000' AS DateTime), CAST(N'2023-03-03T14:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T13:00:00.000' AS DateTime), CAST(N'2023-03-03T14:00:00.000' AS DateTime), CAST(N'2023-03-03T14:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T13:15:00.000' AS DateTime), CAST(N'2023-03-03T14:00:00.000' AS DateTime), CAST(N'2023-03-03T14:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T13:30:00.000' AS DateTime), CAST(N'2023-03-03T14:00:00.000' AS DateTime), CAST(N'2023-03-03T14:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T13:45:00.000' AS DateTime), CAST(N'2023-03-03T14:00:00.000' AS DateTime), CAST(N'2023-03-03T14:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T14:00:00.000' AS DateTime), CAST(N'2023-03-03T14:00:00.000' AS DateTime), CAST(N'2023-03-03T14:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T14:15:00.000' AS DateTime), CAST(N'2023-03-03T15:00:00.000' AS DateTime), CAST(N'2023-03-03T15:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T14:30:00.000' AS DateTime), CAST(N'2023-03-03T15:00:00.000' AS DateTime), CAST(N'2023-03-03T15:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T14:45:00.000' AS DateTime), CAST(N'2023-03-03T15:00:00.000' AS DateTime), CAST(N'2023-03-03T15:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T15:00:00.000' AS DateTime), CAST(N'2023-03-03T15:00:00.000' AS DateTime), CAST(N'2023-03-03T15:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T15:15:00.000' AS DateTime), CAST(N'2023-03-03T16:00:00.000' AS DateTime), CAST(N'2023-03-03T16:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T15:30:00.000' AS DateTime), CAST(N'2023-03-03T16:00:00.000' AS DateTime), CAST(N'2023-03-03T16:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T15:45:00.000' AS DateTime), CAST(N'2023-03-03T16:00:00.000' AS DateTime), CAST(N'2023-03-03T16:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T16:00:00.000' AS DateTime), CAST(N'2023-03-03T16:00:00.000' AS DateTime), CAST(N'2023-03-03T16:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T16:15:00.000' AS DateTime), CAST(N'2023-03-03T18:00:00.000' AS DateTime), CAST(N'2023-03-03T18:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T16:30:00.000' AS DateTime), CAST(N'2023-03-03T18:00:00.000' AS DateTime), CAST(N'2023-03-03T18:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T16:45:00.000' AS DateTime), CAST(N'2023-03-03T18:00:00.000' AS DateTime), CAST(N'2023-03-03T18:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T17:00:00.000' AS DateTime), CAST(N'2023-03-03T18:00:00.000' AS DateTime), CAST(N'2023-03-03T18:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T17:15:00.000' AS DateTime), CAST(N'2023-03-03T18:00:00.000' AS DateTime), CAST(N'2023-03-03T18:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-03T17:30:00.000' AS DateTime), CAST(N'2023-03-03T18:00:00.000' AS DateTime), CAST(N'2023-03-03T18:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T07:45:00.000' AS DateTime), CAST(N'2023-03-04T08:00:00.000' AS DateTime), CAST(N'2023-03-04T08:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T08:00:00.000' AS DateTime), CAST(N'2023-03-04T08:00:00.000' AS DateTime), CAST(N'2023-03-04T08:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T11:00:00.000' AS DateTime), CAST(N'2023-03-04T11:00:00.000' AS DateTime), CAST(N'2023-03-04T11:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T11:15:00.000' AS DateTime), CAST(N'2023-03-04T12:00:00.000' AS DateTime), CAST(N'2023-03-04T12:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T11:30:00.000' AS DateTime), CAST(N'2023-03-04T12:00:00.000' AS DateTime), CAST(N'2023-03-04T12:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T11:45:00.000' AS DateTime), CAST(N'2023-03-04T12:00:00.000' AS DateTime), CAST(N'2023-03-04T12:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T12:00:00.000' AS DateTime), CAST(N'2023-03-04T12:00:00.000' AS DateTime), CAST(N'2023-03-04T12:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T12:15:00.000' AS DateTime), CAST(N'2023-03-04T13:00:00.000' AS DateTime), CAST(N'2023-03-04T13:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T12:30:00.000' AS DateTime), CAST(N'2023-03-04T13:00:00.000' AS DateTime), CAST(N'2023-03-04T13:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T12:45:00.000' AS DateTime), CAST(N'2023-03-04T13:00:00.000' AS DateTime), CAST(N'2023-03-04T13:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T13:00:00.000' AS DateTime), CAST(N'2023-03-04T13:00:00.000' AS DateTime), CAST(N'2023-03-04T13:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T13:15:00.000' AS DateTime), CAST(N'2023-03-04T14:00:00.000' AS DateTime), CAST(N'2023-03-04T14:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T13:30:00.000' AS DateTime), CAST(N'2023-03-04T14:00:00.000' AS DateTime), CAST(N'2023-03-04T14:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T13:45:00.000' AS DateTime), CAST(N'2023-03-04T14:00:00.000' AS DateTime), CAST(N'2023-03-04T14:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T14:00:00.000' AS DateTime), CAST(N'2023-03-04T14:00:00.000' AS DateTime), CAST(N'2023-03-04T14:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T14:15:00.000' AS DateTime), CAST(N'2023-03-04T15:00:00.000' AS DateTime), CAST(N'2023-03-04T15:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T14:30:00.000' AS DateTime), CAST(N'2023-03-04T15:00:00.000' AS DateTime), CAST(N'2023-03-04T15:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T14:45:00.000' AS DateTime), CAST(N'2023-03-04T15:00:00.000' AS DateTime), CAST(N'2023-03-04T15:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T15:00:00.000' AS DateTime), CAST(N'2023-03-04T15:00:00.000' AS DateTime), CAST(N'2023-03-04T15:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T15:15:00.000' AS DateTime), CAST(N'2023-03-04T17:00:00.000' AS DateTime), CAST(N'2023-03-04T17:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T15:30:00.000' AS DateTime), CAST(N'2023-03-04T17:00:00.000' AS DateTime), CAST(N'2023-03-04T17:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T15:45:00.000' AS DateTime), CAST(N'2023-03-04T17:00:00.000' AS DateTime), CAST(N'2023-03-04T17:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T16:00:00.000' AS DateTime), CAST(N'2023-03-04T17:00:00.000' AS DateTime), CAST(N'2023-03-04T17:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T16:15:00.000' AS DateTime), CAST(N'2023-03-04T17:00:00.000' AS DateTime), CAST(N'2023-03-04T17:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T16:30:00.000' AS DateTime), CAST(N'2023-03-04T17:00:00.000' AS DateTime), CAST(N'2023-03-04T17:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T16:45:00.000' AS DateTime), CAST(N'2023-03-04T17:00:00.000' AS DateTime), CAST(N'2023-03-04T17:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T17:00:00.000' AS DateTime), CAST(N'2023-03-04T17:00:00.000' AS DateTime), CAST(N'2023-03-04T17:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T17:15:00.000' AS DateTime), CAST(N'2023-03-04T18:00:00.000' AS DateTime), CAST(N'2023-03-04T18:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T17:30:00.000' AS DateTime), CAST(N'2023-03-04T18:00:00.000' AS DateTime), CAST(N'2023-03-04T18:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T17:45:00.000' AS DateTime), CAST(N'2023-03-04T18:00:00.000' AS DateTime), CAST(N'2023-03-04T18:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0, CAST(N'2023-03-04T18:00:00.000' AS DateTime), CAST(N'2023-03-04T18:00:00.000' AS DateTime), CAST(N'2023-03-04T18:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.003, CAST(N'2023-03-03T17:45:00.000' AS DateTime), CAST(N'2023-03-03T18:00:00.000' AS DateTime), CAST(N'2023-03-03T18:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.005, CAST(N'2023-03-04T07:30:00.000' AS DateTime), CAST(N'2023-03-04T08:00:00.000' AS DateTime), CAST(N'2023-03-04T08:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.008, CAST(N'2023-03-03T11:30:00.000' AS DateTime), CAST(N'2023-03-03T12:00:00.000' AS DateTime), CAST(N'2023-03-03T12:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.016, CAST(N'2023-03-04T18:15:00.000' AS DateTime), CAST(N'2023-03-04T19:00:00.000' AS DateTime), CAST(N'2023-03-04T19:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.022, CAST(N'2023-03-03T18:00:00.000' AS DateTime), CAST(N'2023-03-03T18:00:00.000' AS DateTime), CAST(N'2023-03-03T18:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.047, CAST(N'2023-03-04T07:15:00.000' AS DateTime), CAST(N'2023-03-04T08:00:00.000' AS DateTime), CAST(N'2023-03-04T08:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.059, CAST(N'2023-03-03T05:30:00.000' AS DateTime), CAST(N'2023-03-03T06:00:00.000' AS DateTime), CAST(N'2023-03-03T06:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.06, CAST(N'2023-03-03T05:15:00.000' AS DateTime), CAST(N'2023-03-03T06:00:00.000' AS DateTime), CAST(N'2023-03-03T06:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.061, CAST(N'2023-03-03T02:15:00.000' AS DateTime), CAST(N'2023-03-03T03:00:00.000' AS DateTime), CAST(N'2023-03-03T03:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.061, CAST(N'2023-03-03T03:15:00.000' AS DateTime), CAST(N'2023-03-03T04:00:00.000' AS DateTime), CAST(N'2023-03-03T04:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.061, CAST(N'2023-03-03T04:15:00.000' AS DateTime), CAST(N'2023-03-03T05:00:00.000' AS DateTime), CAST(N'2023-03-03T05:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.061, CAST(N'2023-03-03T06:30:00.000' AS DateTime), CAST(N'2023-03-03T07:00:00.000' AS DateTime), CAST(N'2023-03-03T07:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.061, CAST(N'2023-03-04T05:00:00.000' AS DateTime), CAST(N'2023-03-04T05:00:00.000' AS DateTime), CAST(N'2023-03-04T05:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.061, CAST(N'2023-03-04T06:45:00.000' AS DateTime), CAST(N'2023-03-04T07:00:00.000' AS DateTime), CAST(N'2023-03-04T07:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.062, CAST(N'2023-03-03T01:15:00.000' AS DateTime), CAST(N'2023-03-03T02:00:00.000' AS DateTime), CAST(N'2023-03-03T02:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.063, CAST(N'2023-03-04T01:45:00.000' AS DateTime), CAST(N'2023-03-04T02:00:00.000' AS DateTime), CAST(N'2023-03-04T02:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.063, CAST(N'2023-03-04T02:30:00.000' AS DateTime), CAST(N'2023-03-04T03:00:00.000' AS DateTime), CAST(N'2023-03-04T03:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.063, CAST(N'2023-03-04T03:15:00.000' AS DateTime), CAST(N'2023-03-04T04:00:00.000' AS DateTime), CAST(N'2023-03-04T04:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.064, CAST(N'2023-03-04T04:00:00.000' AS DateTime), CAST(N'2023-03-04T04:00:00.000' AS DateTime), CAST(N'2023-03-04T04:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.064, CAST(N'2023-03-04T05:45:00.000' AS DateTime), CAST(N'2023-03-04T06:00:00.000' AS DateTime), CAST(N'2023-03-04T06:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.065, CAST(N'2023-03-04T01:00:00.000' AS DateTime), CAST(N'2023-03-04T01:00:00.000' AS DateTime), CAST(N'2023-03-04T01:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.066, CAST(N'2023-03-03T06:15:00.000' AS DateTime), CAST(N'2023-03-03T07:00:00.000' AS DateTime), CAST(N'2023-03-03T07:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.067, CAST(N'2023-03-03T00:30:00.000' AS DateTime), CAST(N'2023-03-03T01:00:00.000' AS DateTime), CAST(N'2023-03-03T01:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.068, CAST(N'2023-03-03T00:15:00.000' AS DateTime), CAST(N'2023-03-03T01:00:00.000' AS DateTime), CAST(N'2023-03-03T01:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.068, CAST(N'2023-03-03T04:00:00.000' AS DateTime), CAST(N'2023-03-03T04:00:00.000' AS DateTime), CAST(N'2023-03-03T04:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.068, CAST(N'2023-03-04T00:15:00.000' AS DateTime), CAST(N'2023-03-04T01:00:00.000' AS DateTime), CAST(N'2023-03-04T01:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.069, CAST(N'2023-03-03T03:00:00.000' AS DateTime), CAST(N'2023-03-03T03:00:00.000' AS DateTime), CAST(N'2023-03-03T03:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.069, CAST(N'2023-03-03T04:30:00.000' AS DateTime), CAST(N'2023-03-03T05:00:00.000' AS DateTime), CAST(N'2023-03-03T05:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.069, CAST(N'2023-03-04T04:45:00.000' AS DateTime), CAST(N'2023-03-04T05:00:00.000' AS DateTime), CAST(N'2023-03-04T05:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.071, CAST(N'2023-03-03T02:00:00.000' AS DateTime), CAST(N'2023-03-03T02:00:00.000' AS DateTime), CAST(N'2023-03-03T02:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.071, CAST(N'2023-03-03T03:30:00.000' AS DateTime), CAST(N'2023-03-03T04:00:00.000' AS DateTime), CAST(N'2023-03-03T04:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.072, CAST(N'2023-03-03T01:30:00.000' AS DateTime), CAST(N'2023-03-03T02:00:00.000' AS DateTime), CAST(N'2023-03-03T02:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.073, CAST(N'2023-03-03T02:30:00.000' AS DateTime), CAST(N'2023-03-03T03:00:00.000' AS DateTime), CAST(N'2023-03-03T03:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.074, CAST(N'2023-03-03T01:00:00.000' AS DateTime), CAST(N'2023-03-03T01:00:00.000' AS DateTime), CAST(N'2023-03-03T01:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.074, CAST(N'2023-03-04T04:15:00.000' AS DateTime), CAST(N'2023-03-04T05:00:00.000' AS DateTime), CAST(N'2023-03-04T05:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.076, CAST(N'2023-03-04T02:15:00.000' AS DateTime), CAST(N'2023-03-04T03:00:00.000' AS DateTime), CAST(N'2023-03-04T03:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.076, CAST(N'2023-03-04T06:30:00.000' AS DateTime), CAST(N'2023-03-04T07:00:00.000' AS DateTime), CAST(N'2023-03-04T07:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.077, CAST(N'2023-03-03T06:45:00.000' AS DateTime), CAST(N'2023-03-03T07:00:00.000' AS DateTime), CAST(N'2023-03-03T07:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.077, CAST(N'2023-03-04T01:30:00.000' AS DateTime), CAST(N'2023-03-04T02:00:00.000' AS DateTime), CAST(N'2023-03-04T02:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.078, CAST(N'2023-03-04T00:45:00.000' AS DateTime), CAST(N'2023-03-04T01:00:00.000' AS DateTime), CAST(N'2023-03-04T01:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.078, CAST(N'2023-03-04T06:00:00.000' AS DateTime), CAST(N'2023-03-04T06:00:00.000' AS DateTime), CAST(N'2023-03-04T06:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.079, CAST(N'2023-03-03T23:30:00.000' AS DateTime), CAST(N'2023-03-04T00:00:00.000' AS DateTime), CAST(N'2023-03-04T00:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.08, CAST(N'2023-03-04T03:00:00.000' AS DateTime), CAST(N'2023-03-04T03:00:00.000' AS DateTime), CAST(N'2023-03-04T03:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.08, CAST(N'2023-03-04T03:30:00.000' AS DateTime), CAST(N'2023-03-04T04:00:00.000' AS DateTime), CAST(N'2023-03-04T04:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.08, CAST(N'2023-03-04T05:30:00.000' AS DateTime), CAST(N'2023-03-04T06:00:00.000' AS DateTime), CAST(N'2023-03-04T06:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.081, CAST(N'2023-03-03T03:45:00.000' AS DateTime), CAST(N'2023-03-03T04:00:00.000' AS DateTime), CAST(N'2023-03-03T04:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.082, CAST(N'2023-03-03T00:45:00.000' AS DateTime), CAST(N'2023-03-03T01:00:00.000' AS DateTime), CAST(N'2023-03-03T01:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.082, CAST(N'2023-03-03T02:45:00.000' AS DateTime), CAST(N'2023-03-03T03:00:00.000' AS DateTime), CAST(N'2023-03-03T03:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.082, CAST(N'2023-03-04T05:15:00.000' AS DateTime), CAST(N'2023-03-04T06:00:00.000' AS DateTime), CAST(N'2023-03-04T06:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.083, CAST(N'2023-03-03T01:45:00.000' AS DateTime), CAST(N'2023-03-03T02:00:00.000' AS DateTime), CAST(N'2023-03-03T02:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.083, CAST(N'2023-03-03T04:45:00.000' AS DateTime), CAST(N'2023-03-03T05:00:00.000' AS DateTime), CAST(N'2023-03-03T05:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.083, CAST(N'2023-03-04T01:15:00.000' AS DateTime), CAST(N'2023-03-04T02:00:00.000' AS DateTime), CAST(N'2023-03-04T02:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.083, CAST(N'2023-03-04T04:30:00.000' AS DateTime), CAST(N'2023-03-04T05:00:00.000' AS DateTime), CAST(N'2023-03-04T05:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.084, CAST(N'2023-03-03T05:45:00.000' AS DateTime), CAST(N'2023-03-03T06:00:00.000' AS DateTime), CAST(N'2023-03-03T06:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.084, CAST(N'2023-03-04T00:30:00.000' AS DateTime), CAST(N'2023-03-04T01:00:00.000' AS DateTime), CAST(N'2023-03-04T01:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.084, CAST(N'2023-03-04T02:00:00.000' AS DateTime), CAST(N'2023-03-04T02:00:00.000' AS DateTime), CAST(N'2023-03-04T02:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.084, CAST(N'2023-03-04T03:45:00.000' AS DateTime), CAST(N'2023-03-04T04:00:00.000' AS DateTime), CAST(N'2023-03-04T04:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.084, CAST(N'2023-03-04T06:15:00.000' AS DateTime), CAST(N'2023-03-04T07:00:00.000' AS DateTime), CAST(N'2023-03-04T07:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.085, CAST(N'2023-03-03T07:00:00.000' AS DateTime), CAST(N'2023-03-03T07:00:00.000' AS DateTime), CAST(N'2023-03-03T07:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.085, CAST(N'2023-03-03T23:45:00.000' AS DateTime), CAST(N'2023-03-04T00:00:00.000' AS DateTime), CAST(N'2023-03-04T00:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.085, CAST(N'2023-03-04T02:45:00.000' AS DateTime), CAST(N'2023-03-04T03:00:00.000' AS DateTime), CAST(N'2023-03-04T03:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.085, CAST(N'2023-03-04T07:00:00.000' AS DateTime), CAST(N'2023-03-04T07:00:00.000' AS DateTime), CAST(N'2023-03-04T07:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.085, CAST(N'2023-03-04T22:45:00.000' AS DateTime), CAST(N'2023-03-04T23:00:00.000' AS DateTime), CAST(N'2023-03-04T23:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.086, CAST(N'2023-03-03T00:00:00.000' AS DateTime), CAST(N'2023-03-03T00:00:00.000' AS DateTime), CAST(N'2023-03-03T00:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.09, CAST(N'2023-03-03T05:00:00.000' AS DateTime), CAST(N'2023-03-03T05:00:00.000' AS DateTime), CAST(N'2023-03-03T05:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.09, CAST(N'2023-03-04T00:00:00.000' AS DateTime), CAST(N'2023-03-04T00:00:00.000' AS DateTime), CAST(N'2023-03-04T00:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.094, CAST(N'2023-03-03T23:00:00.000' AS DateTime), CAST(N'2023-03-03T23:00:00.000' AS DateTime), CAST(N'2023-03-03T23:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.096, CAST(N'2023-03-03T22:45:00.000' AS DateTime), CAST(N'2023-03-03T23:00:00.000' AS DateTime), CAST(N'2023-03-03T23:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.096, CAST(N'2023-03-04T23:00:00.000' AS DateTime), CAST(N'2023-03-04T23:00:00.000' AS DateTime), CAST(N'2023-03-04T23:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.099, CAST(N'2023-03-03T20:45:00.000' AS DateTime), CAST(N'2023-03-03T21:00:00.000' AS DateTime), CAST(N'2023-03-03T21:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.104, CAST(N'2023-03-03T23:15:00.000' AS DateTime), CAST(N'2023-03-04T00:00:00.000' AS DateTime), CAST(N'2023-03-04T00:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.105, CAST(N'2023-03-04T18:30:00.000' AS DateTime), CAST(N'2023-03-04T19:00:00.000' AS DateTime), CAST(N'2023-03-04T19:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.105, CAST(N'2023-03-04T22:30:00.000' AS DateTime), CAST(N'2023-03-04T23:00:00.000' AS DateTime), CAST(N'2023-03-04T23:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.106, CAST(N'2023-03-03T21:00:00.000' AS DateTime), CAST(N'2023-03-03T21:00:00.000' AS DateTime), CAST(N'2023-03-03T21:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.108, CAST(N'2023-03-03T06:00:00.000' AS DateTime), CAST(N'2023-03-03T06:00:00.000' AS DateTime), CAST(N'2023-03-03T06:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.108, CAST(N'2023-03-03T22:30:00.000' AS DateTime), CAST(N'2023-03-03T23:00:00.000' AS DateTime), CAST(N'2023-03-03T23:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.109, CAST(N'2023-03-03T20:30:00.000' AS DateTime), CAST(N'2023-03-03T21:00:00.000' AS DateTime), CAST(N'2023-03-03T21:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.11, CAST(N'2023-03-04T22:00:00.000' AS DateTime), CAST(N'2023-03-04T22:00:00.000' AS DateTime), CAST(N'2023-03-04T22:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.116, CAST(N'2023-03-04T18:45:00.000' AS DateTime), CAST(N'2023-03-04T19:00:00.000' AS DateTime), CAST(N'2023-03-04T19:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.117, CAST(N'2023-03-03T20:15:00.000' AS DateTime), CAST(N'2023-03-03T21:00:00.000' AS DateTime), CAST(N'2023-03-03T21:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.119, CAST(N'2023-03-03T19:45:00.000' AS DateTime), CAST(N'2023-03-03T20:00:00.000' AS DateTime), CAST(N'2023-03-03T20:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.121, CAST(N'2023-03-03T20:00:00.000' AS DateTime), CAST(N'2023-03-03T20:00:00.000' AS DateTime), CAST(N'2023-03-03T20:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.121, CAST(N'2023-03-03T22:15:00.000' AS DateTime), CAST(N'2023-03-03T23:00:00.000' AS DateTime), CAST(N'2023-03-03T23:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.126, CAST(N'2023-03-04T22:15:00.000' AS DateTime), CAST(N'2023-03-04T23:00:00.000' AS DateTime), CAST(N'2023-03-04T23:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.127, CAST(N'2023-03-04T21:45:00.000' AS DateTime), CAST(N'2023-03-04T22:00:00.000' AS DateTime), CAST(N'2023-03-04T22:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.132, CAST(N'2023-03-03T18:45:00.000' AS DateTime), CAST(N'2023-03-03T19:00:00.000' AS DateTime), CAST(N'2023-03-03T19:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.134, CAST(N'2023-03-04T20:30:00.000' AS DateTime), CAST(N'2023-03-04T21:00:00.000' AS DateTime), CAST(N'2023-03-04T21:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.134, CAST(N'2023-03-04T23:15:00.000' AS DateTime), CAST(N'2023-03-05T00:00:00.000' AS DateTime), CAST(N'2023-03-05T00:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.135, CAST(N'2023-03-04T21:30:00.000' AS DateTime), CAST(N'2023-03-04T22:00:00.000' AS DateTime), CAST(N'2023-03-04T22:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.136, CAST(N'2023-03-04T19:00:00.000' AS DateTime), CAST(N'2023-03-04T19:00:00.000' AS DateTime), CAST(N'2023-03-04T19:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.138, CAST(N'2023-03-04T23:30:00.000' AS DateTime), CAST(N'2023-03-05T00:00:00.000' AS DateTime), CAST(N'2023-03-05T00:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.139, CAST(N'2023-03-04T20:15:00.000' AS DateTime), CAST(N'2023-03-04T21:00:00.000' AS DateTime), CAST(N'2023-03-04T21:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.139, CAST(N'2023-03-04T20:45:00.000' AS DateTime), CAST(N'2023-03-04T21:00:00.000' AS DateTime), CAST(N'2023-03-04T21:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.146, CAST(N'2023-03-04T21:00:00.000' AS DateTime), CAST(N'2023-03-04T21:00:00.000' AS DateTime), CAST(N'2023-03-04T21:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.148, CAST(N'2023-03-03T19:00:00.000' AS DateTime), CAST(N'2023-03-03T19:00:00.000' AS DateTime), CAST(N'2023-03-03T19:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.152, CAST(N'2023-03-04T23:45:00.000' AS DateTime), CAST(N'2023-03-05T00:00:00.000' AS DateTime), CAST(N'2023-03-05T00:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.157, CAST(N'2023-03-03T18:15:00.000' AS DateTime), CAST(N'2023-03-03T19:00:00.000' AS DateTime), CAST(N'2023-03-03T19:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.157, CAST(N'2023-03-03T19:15:00.000' AS DateTime), CAST(N'2023-03-03T20:00:00.000' AS DateTime), CAST(N'2023-03-03T20:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.157, CAST(N'2023-03-04T19:45:00.000' AS DateTime), CAST(N'2023-03-04T20:00:00.000' AS DateTime), CAST(N'2023-03-04T20:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.169, CAST(N'2023-03-04T21:15:00.000' AS DateTime), CAST(N'2023-03-04T22:00:00.000' AS DateTime), CAST(N'2023-03-04T22:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.177, CAST(N'2023-03-04T19:15:00.000' AS DateTime), CAST(N'2023-03-04T20:00:00.000' AS DateTime), CAST(N'2023-03-04T20:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.182, CAST(N'2023-03-04T20:00:00.000' AS DateTime), CAST(N'2023-03-04T20:00:00.000' AS DateTime), CAST(N'2023-03-04T20:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.202, CAST(N'2023-03-04T19:30:00.000' AS DateTime), CAST(N'2023-03-04T20:00:00.000' AS DateTime), CAST(N'2023-03-04T20:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.215, CAST(N'2023-03-03T19:30:00.000' AS DateTime), CAST(N'2023-03-03T20:00:00.000' AS DateTime), CAST(N'2023-03-03T20:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.252, CAST(N'2023-03-03T18:30:00.000' AS DateTime), CAST(N'2023-03-03T19:00:00.000' AS DateTime), CAST(N'2023-03-03T19:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.282, CAST(N'2023-03-03T22:00:00.000' AS DateTime), CAST(N'2023-03-03T22:00:00.000' AS DateTime), CAST(N'2023-03-03T22:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.499, CAST(N'2023-03-04T10:45:00.000' AS DateTime), CAST(N'2023-03-04T11:00:00.000' AS DateTime), CAST(N'2023-03-04T11:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.529, CAST(N'2023-03-03T21:45:00.000' AS DateTime), CAST(N'2023-03-03T22:00:00.000' AS DateTime), CAST(N'2023-03-03T22:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.543, CAST(N'2023-03-03T11:15:00.000' AS DateTime), CAST(N'2023-03-03T12:00:00.000' AS DateTime), CAST(N'2023-03-03T12:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.687, CAST(N'2023-03-03T21:30:00.000' AS DateTime), CAST(N'2023-03-03T22:00:00.000' AS DateTime), CAST(N'2023-03-03T22:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.752, CAST(N'2023-03-03T11:00:00.000' AS DateTime), CAST(N'2023-03-03T11:00:00.000' AS DateTime), CAST(N'2023-03-03T11:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.823, CAST(N'2023-03-03T10:45:00.000' AS DateTime), CAST(N'2023-03-03T11:00:00.000' AS DateTime), CAST(N'2023-03-03T11:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.896, CAST(N'2023-03-04T10:30:00.000' AS DateTime), CAST(N'2023-03-04T11:00:00.000' AS DateTime), CAST(N'2023-03-04T11:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 0.96, CAST(N'2023-03-04T10:15:00.000' AS DateTime), CAST(N'2023-03-04T11:00:00.000' AS DateTime), CAST(N'2023-03-04T11:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.003, CAST(N'2023-03-03T10:15:00.000' AS DateTime), CAST(N'2023-03-03T11:00:00.000' AS DateTime), CAST(N'2023-03-03T11:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.053, CAST(N'2023-03-04T10:00:00.000' AS DateTime), CAST(N'2023-03-04T10:00:00.000' AS DateTime), CAST(N'2023-03-04T10:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.118, CAST(N'2023-03-03T10:00:00.000' AS DateTime), CAST(N'2023-03-03T10:00:00.000' AS DateTime), CAST(N'2023-03-03T10:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.154, CAST(N'2023-03-04T09:45:00.000' AS DateTime), CAST(N'2023-03-04T10:00:00.000' AS DateTime), CAST(N'2023-03-04T10:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.228, CAST(N'2023-03-03T10:30:00.000' AS DateTime), CAST(N'2023-03-03T11:00:00.000' AS DateTime), CAST(N'2023-03-03T11:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.253, CAST(N'2023-03-03T21:15:00.000' AS DateTime), CAST(N'2023-03-03T22:00:00.000' AS DateTime), CAST(N'2023-03-03T22:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.269, CAST(N'2023-03-03T09:45:00.000' AS DateTime), CAST(N'2023-03-03T10:00:00.000' AS DateTime), CAST(N'2023-03-03T10:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.269, CAST(N'2023-03-04T09:30:00.000' AS DateTime), CAST(N'2023-03-04T10:00:00.000' AS DateTime), CAST(N'2023-03-04T10:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.367, CAST(N'2023-03-03T09:30:00.000' AS DateTime), CAST(N'2023-03-03T10:00:00.000' AS DateTime), CAST(N'2023-03-03T10:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.418, CAST(N'2023-03-04T09:15:00.000' AS DateTime), CAST(N'2023-03-04T10:00:00.000' AS DateTime), CAST(N'2023-03-04T10:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.532, CAST(N'2023-03-03T09:15:00.000' AS DateTime), CAST(N'2023-03-03T10:00:00.000' AS DateTime), CAST(N'2023-03-03T10:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.583, CAST(N'2023-03-04T09:00:00.000' AS DateTime), CAST(N'2023-03-04T10:00:00.000' AS DateTime), CAST(N'2023-03-04T10:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.703, CAST(N'2023-03-04T08:45:00.000' AS DateTime), CAST(N'2023-03-04T10:00:00.000' AS DateTime), CAST(N'2023-03-04T10:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.715, CAST(N'2023-03-03T09:00:00.000' AS DateTime), CAST(N'2023-03-03T09:00:00.000' AS DateTime), CAST(N'2023-03-03T09:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.832, CAST(N'2023-03-04T08:30:00.000' AS DateTime), CAST(N'2023-03-04T10:00:00.000' AS DateTime), CAST(N'2023-03-04T10:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.937, CAST(N'2023-03-04T08:15:00.000' AS DateTime), CAST(N'2023-03-04T10:00:00.000' AS DateTime), CAST(N'2023-03-04T10:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 1.955, CAST(N'2023-03-03T08:45:00.000' AS DateTime), CAST(N'2023-03-03T09:00:00.000' AS DateTime), CAST(N'2023-03-03T09:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 2.014, CAST(N'2023-03-03T08:30:00.000' AS DateTime), CAST(N'2023-03-03T09:00:00.000' AS DateTime), CAST(N'2023-03-03T09:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 2.067, CAST(N'2023-03-03T08:15:00.000' AS DateTime), CAST(N'2023-03-03T09:00:00.000' AS DateTime), CAST(N'2023-03-03T09:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 2.194, CAST(N'2023-03-03T08:00:00.000' AS DateTime), CAST(N'2023-03-03T08:00:00.000' AS DateTime), CAST(N'2023-03-03T08:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 2.253, CAST(N'2023-03-03T07:45:00.000' AS DateTime), CAST(N'2023-03-03T08:00:00.000' AS DateTime), CAST(N'2023-03-03T08:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 2.3, CAST(N'2023-03-03T07:15:00.000' AS DateTime), CAST(N'2023-03-03T08:00:00.000' AS DateTime), CAST(N'2023-03-03T08:00:00.000' AS DateTime))
GO
INSERT [dbo].[test_rr_data] ([ID], [UNIT], [Time_1], [Time_2], [Time_3]) VALUES (CAST(109 AS Numeric(18, 0)), 2.325, CAST(N'2023-03-03T07:30:00.000' AS DateTime), CAST(N'2023-03-03T08:00:00.000' AS DateTime), CAST(N'2023-03-03T08:00:00.000' AS DateTime))
GO
SELECT
CAST(Time_2 AS date) AS Date,
CAST(SUM(CASE WHEN DATEPART(HOUR, Time_2) = 1 THEN Unit ELSE 0 END) AS decimal(9, 3)) AS [1:00],
CAST(SUM(CASE WHEN DATEPART(HOUR, Time_2) = 2 THEN Unit ELSE 0 END) AS decimal(9, 3)) AS [2:00],
CAST(SUM(CASE WHEN DATEPART(HOUR, Time_2) = 3 THEN Unit ELSE 0 END) AS decimal(9, 3)) AS [3:00],
CAST(SUM(CASE WHEN DATEPART(HOUR, Time_2) = 4 THEN Unit ELSE 0 END) AS decimal(9, 3)) AS [4:00],
CAST(SUM(CASE WHEN DATEPART(HOUR, Time_2) = 5 THEN Unit ELSE 0 END) AS decimal(9, 3)) AS [5:00],
CAST(SUM(CASE WHEN DATEPART(HOUR, Time_2) = 6 THEN Unit ELSE 0 END) AS decimal(9, 3)) AS [6:00], --...,
CAST(SUM(Unit) AS decimal(9, 3)) AS SUM
FROM dbo.test_rr_data
GROUP BY CAST(Time_2 AS date)
ORDER BY CAST(Time_2 AS date)
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
April 26, 2023 at 12:59 am
@scottpletcher , sorry for ghosting you. I saw your reply and went with your solution. Appreciate the help !
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply