query sql server - 分组字段

时间:2018-02-05 15:35:03

标签: sql sql-server database sql-server-2008 sql-server-2008-r2

我有这个查询

SELECT 
     B.IdDepartment,
     B.IdParent,
     CASE 
        WHEN B.IdParent = 3 THEN 'SANTO DOMINGO'
        WHEN B.IdParent = 4 THEN 'BAVARO'
        ELSE 'INACTIVOS' END AS Localidad, 
     A.IdUser As Codigo, 
     A.Name As Nombre, 
     B.Description As Departamento,
     CONVERT(DATE,C.RecordTime,102) As Fecha,
     CASE
        WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 1 
            THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2InHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2InMinute),2) + ':00')
                  FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 6 AND H.IdUser = A.IdUser)
        WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 2 
            THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2InHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2InMinute),2) + ':00')
                  FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 0 AND H.IdUser = A.IdUser)
        WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 3 
            THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2InHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2InMinute),2) + ':00')
                  FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 1 AND H.IdUser = A.IdUser)
        WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 4 
            THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2InHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2InMinute),2) + ':00')
                  FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 2 AND H.IdUser = A.IdUser)
        WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 5 
            THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2InHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2InMinute),2) + ':00')
                  FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 3 AND H.IdUser = A.IdUser)
        WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 6 
            THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2InHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2InMinute),2) + ':00')
                  FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 4 AND H.IdUser = A.IdUser)
        WHEN  (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 7
            THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2InHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2InMinute),2) + ':00')
                FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 5 AND H.IdUser = A.IdUser)
            END AS [Hora Entrada],
     CASE
        WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 1 
            THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2OutHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2OutMinute),2) + ':00')
                  FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 6 AND H.IdUser = A.IdUser)
        WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 2 
            THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2OutHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2OutMinute),2) + ':00')
                  FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 0 AND H.IdUser = A.IdUser)
        WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 3 
            THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2OutHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2OutMinute),2) + ':00')
                  FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 1 AND H.IdUser = A.IdUser)
        WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 4 
            THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2OutHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2OutMinute),2) + ':00')
                  FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 2 AND H.IdUser = A.IdUser)
        WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 5 
            THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2OutHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2OutMinute),2) + ':00')
                  FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 3 AND H.IdUser = A.IdUser)
        WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 6 
            THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2OutHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2OutMinute),2) + ':00')
                  FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 4 AND H.IdUser = A.IdUser)
        WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 7
            THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2OutHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2OutMinute),2) + ':00')
                FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 5 AND H.IdUser = A.IdUser)
            END AS [Hora Salida],
     CASE
        WHEN(SELECT H.CuttingHour FROM Shift H INNER JOIN UserShift G ON H.ShiftId = G.ShiftId WHERE G.IdUser = A.IdUser) <> 0
            THEN (SELECT MAX(CONVERT(TIME,RecordTime)) FROM Record M WHERE M.RecordTime BETWEEN (SELECT DATEADD(HOUR,(SELECT CuttingHour FROM Shift X INNER JOIN UserShift Z ON X.ShiftId = Z.ShiftId WHERE Z.IdUser = A.IdUser),(SELECT CONVERT(DATETIME,C.RecordTime)))) AND (SELECT DATEADD(HOUR,(SELECT CuttingHour FROM Shift X INNER JOIN UserShift Z ON X.ShiftId = Z.ShiftId WHERE Z.IdUser = A.IdUser),(SELECT CONVERT(DATETIME,DATEADD(DD,1,CONVERT(DATE,C.RecordTime)))))) AND M.IdUser = A.IdUser)
        WHEN(SELECT H.CuttingHour FROM Shift H INNER JOIN UserShift G ON H.ShiftId = G.ShiftId WHERE G.IdUser = A.IdUser) = 0
           THEN (MIN(CONVERT(TIME,C.RecordTime)))
     END As [Registro Entrada],
     CASE
        WHEN(SELECT CuttingHour FROM Shift H INNER JOIN UserShift G ON H.ShiftId = G.ShiftId WHERE G.IdUser = A.IdUser) <> 0
            THEN (SELECT MIN(CONVERT(TIME,RecordTime)) FROM Record M WHERE M.RecordTime BETWEEN (SELECT DATEADD(HOUR,(SELECT CuttingHour FROM Shift X INNER JOIN UserShift Z ON X.ShiftId = Z.ShiftId WHERE Z.IdUser = A.IdUser),(SELECT CONVERT(DATETIME,C.RecordTime)))) AND (SELECT DATEADD(HOUR,(SELECT CuttingHour FROM Shift X INNER JOIN UserShift Z ON X.ShiftId = Z.ShiftId WHERE Z.IdUser = A.IdUser),(SELECT CONVERT(DATETIME,DATEADD(DD,1,CONVERT(DATE,C.RecordTime)))))) AND M.IdUser = A.IdUser)
        WHEN(SELECT H.CuttingHour FROM Shift H INNER JOIN UserShift G ON H.ShiftId = G.ShiftId WHERE G.IdUser = A.IdUser) = 0
           THEN (MAX(CONVERT(TIME,C.RecordTime)))
    END As [Registro Salida]
FROM [User] A 
INNER JOIN  Department B ON A.IdDepartment = B.IdDepartment
INNER JOIN Record C ON A.IdUser = C.IdUser
INNER JOIN UserShift E ON A.IdUser = E.IdUser 
INNER JOIN Shift D ON E.ShiftId = D.ShiftId
INNER JOIN ShiftDetail F ON E.ShiftId = F.ShiftId
WHERE A.IdUser = '5516'
GROUP BY B.IdDepartment, B.IdParent, A.IdUser, A.Name, B.Description, CONVERT(DATE,C.RecordTime,102),
(DATEPART(WEEKDAY,C.RecordTime))

但是当我尝试执行查询时,它会抛出以下错误

Msg 8120, Level 16, State 1, Line 13
Column 'Record.RecordTime' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

但是我试图把它放在查询中因为依赖,如果你有截止时间就是说截止时间不是零,但是抛出了我上面提到的错误,我不知道是什么错误是

预期结果

enter image description here

但是,如果我触摸记录时间字段,它会给我带来这些结果,而我想要的那些是其他图像

enter image description here

1 个答案:

答案 0 :(得分:0)

问题是Registro EntradaRegistro Salida

 CASE
    WHEN(SELECT H.CuttingHour FROM Shift H INNER JOIN UserShift G ON H.ShiftId = G.ShiftId WHERE G.IdUser = A.IdUser) <> 0
        THEN (SELECT MAX(CONVERT(TIME,RecordTime)) FROM Record M WHERE M.RecordTime BETWEEN (SELECT DATEADD(HOUR,(SELECT CuttingHour FROM Shift X INNER JOIN UserShift Z ON X.ShiftId = Z.ShiftId WHERE Z.IdUser = A.IdUser),(SELECT CONVERT(DATETIME,C.RecordTime)))) AND (SELECT DATEADD(HOUR,(SELECT CuttingHour FROM Shift X INNER JOIN UserShift Z ON X.ShiftId = Z.ShiftId WHERE Z.IdUser = A.IdUser),(SELECT CONVERT(DATETIME,DATEADD(DD,1,CONVERT(DATE,C.RecordTime)))))) AND M.IdUser = A.IdUser)
    WHEN(SELECT H.CuttingHour FROM Shift H INNER JOIN UserShift G ON H.ShiftId = G.ShiftId WHERE G.IdUser = A.IdUser) = 0
       THEN (MIN(CONVERT(TIME,C.RecordTime)))
 END As [Registro Entrada],
 CASE
    WHEN(SELECT CuttingHour FROM Shift H INNER JOIN UserShift G ON H.ShiftId = G.ShiftId WHERE G.IdUser = A.IdUser) <> 0
        THEN (SELECT MIN(CONVERT(TIME,RecordTime)) FROM Record M WHERE M.RecordTime BETWEEN (SELECT DATEADD(HOUR,(SELECT CuttingHour FROM Shift X INNER JOIN UserShift Z ON X.ShiftId = Z.ShiftId WHERE Z.IdUser = A.IdUser),(SELECT CONVERT(DATETIME,C.RecordTime)))) AND (SELECT DATEADD(HOUR,(SELECT CuttingHour FROM Shift X INNER JOIN UserShift Z ON X.ShiftId = Z.ShiftId WHERE Z.IdUser = A.IdUser),(SELECT CONVERT(DATETIME,DATEADD(DD,1,CONVERT(DATE,C.RecordTime)))))) AND M.IdUser = A.IdUser)
    WHEN(SELECT H.CuttingHour FROM Shift H INNER JOIN UserShift G ON H.ShiftId = G.ShiftId WHERE G.IdUser = A.IdUser) = 0
       THEN (MAX(CONVERT(TIME,C.RecordTime)))
END As [Registro Salida]

您必须使用GROUP BY,因为:

(MIN(CONVERT(TIME,C.RecordTime)))

(MAX(CONVERT(TIME,C.RecordTime)))

但您也使用(SELECT CONVERT(DATETIME,C.RecordTime)))),而GROUP BY上没有CONVERT(DATE,C.RecordTime,102), (DATEPART(WEEKDAY,C.RecordTime)。必须是,或仅用C.RecordTime替换(MIN(CONVERT(TIME,C.RecordTime)))

但是这会给你重复的数据。所以我的解决方案是改为子查询 (MAX(CONVERT(TIME,C.RecordTime)))DISTINCT并使用GROUP BY代替SELECT distinct B.IdDepartment, B.IdParent, CASE WHEN B.IdParent = 3 THEN 'SANTO DOMINGO' WHEN B.IdParent = 4 THEN 'BAVARO' ELSE 'INACTIVOS' END AS Localidad, A.IdUser As Codigo, A.Name As Nombre, B.Description As Departamento, CONVERT(DATE,C.RecordTime,102) As Fecha, CASE WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 1 THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2InHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2InMinute),2) + ':00') FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 6 AND H.IdUser = A.IdUser) WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 2 THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2InHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2InMinute),2) + ':00') FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 0 AND H.IdUser = A.IdUser) WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 3 THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2InHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2InMinute),2) + ':00') FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 1 AND H.IdUser = A.IdUser) WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 4 THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2InHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2InMinute),2) + ':00') FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 2 AND H.IdUser = A.IdUser) WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 5 THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2InHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2InMinute),2) + ':00') FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 3 AND H.IdUser = A.IdUser) WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 6 THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2InHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2InMinute),2) + ':00') FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 4 AND H.IdUser = A.IdUser) WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 7 THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2InHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2InMinute),2) + ':00') FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 5 AND H.IdUser = A.IdUser) END AS [Hora Entrada], CASE WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 1 THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2OutHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2OutMinute),2) + ':00') FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 6 AND H.IdUser = A.IdUser) WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 2 THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2OutHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2OutMinute),2) + ':00') FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 0 AND H.IdUser = A.IdUser) WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 3 THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2OutHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2OutMinute),2) + ':00') FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 1 AND H.IdUser = A.IdUser) WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 4 THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2OutHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2OutMinute),2) + ':00') FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 2 AND H.IdUser = A.IdUser) WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 5 THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2OutHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2OutMinute),2) + ':00') FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 3 AND H.IdUser = A.IdUser) WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 6 THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2OutHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2OutMinute),2) + ':00') FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 4 AND H.IdUser = A.IdUser) WHEN (SELECT (DATEPART(WEEKDAY,C.RecordTime))) = 7 THEN (SELECT CONVERT(TIME, LEFT(CONVERT(VARCHAR,G.T2OutHour),2) + ':' + LEFT(CONVERT(VARCHAR,G.T2OutMinute),2) + ':00') FROM ShiftDetail G INNER JOIN UserShift H ON G.ShiftId = H.ShiftId WHERE G.DayId = 5 AND H.IdUser = A.IdUser) END AS [Hora Salida], CASE WHEN(SELECT H.CuttingHour FROM Shift H INNER JOIN UserShift G ON H.ShiftId = G.ShiftId WHERE G.IdUser = A.IdUser) <> 0 THEN (SELECT MAX(CONVERT(TIME,RecordTime)) FROM Record M WHERE M.RecordTime BETWEEN (SELECT DATEADD(HOUR,(SELECT CuttingHour FROM Shift X INNER JOIN UserShift Z ON X.ShiftId = Z.ShiftId WHERE Z.IdUser = A.IdUser),/*(SELECT */CONVERT(DATETIME,C.RecordTime)/*)*/)) AND (SELECT DATEADD(HOUR,(SELECT CuttingHour FROM Shift X INNER JOIN UserShift Z ON X.ShiftId = Z.ShiftId WHERE Z.IdUser = A.IdUser),/*(SELECT */CONVERT(DATETIME,DATEADD(DD,1,CONVERT(DATE,C.RecordTime))/*)*/))) AND M.IdUser = A.IdUser) WHEN(SELECT H.CuttingHour FROM Shift H INNER JOIN UserShift G ON H.ShiftId = G.ShiftId WHERE G.IdUser = A.IdUser) = 0 THEN (select MIN(CONVERT(TIME,M.RecordTime)) from Record M where M.IdUser=A.IdUser and CONVERT(DATE,M.RecordTime,102) = CONVERT(DATE,C.RecordTime,102) and DATEPART(WEEKDAY,M.RecordTime) = (DATEPART(WEEKDAY,C.RecordTime))) END As [Registro Entrada], CASE WHEN(SELECT CuttingHour FROM Shift H INNER JOIN UserShift G ON H.ShiftId = G.ShiftId WHERE G.IdUser = A.IdUser) <> 0 THEN (SELECT MIN(CONVERT(TIME,RecordTime)) FROM Record M WHERE M.RecordTime BETWEEN (SELECT DATEADD(HOUR,(SELECT CuttingHour FROM Shift X INNER JOIN UserShift Z ON X.ShiftId = Z.ShiftId WHERE Z.IdUser = A.IdUser),/*(SELECT */CONVERT(DATETIME,C.RecordTime)/*)*/)) AND (SELECT DATEADD(HOUR,(SELECT CuttingHour FROM Shift X INNER JOIN UserShift Z ON X.ShiftId = Z.ShiftId WHERE Z.IdUser = A.IdUser),/*(SELECT */CONVERT(DATETIME,DATEADD(DD,1,CONVERT(DATE,C.RecordTime))/*)*/))) AND M.IdUser = A.IdUser) WHEN(SELECT H.CuttingHour FROM Shift H INNER JOIN UserShift G ON H.ShiftId = G.ShiftId WHERE G.IdUser = A.IdUser) = 0 THEN (select MAX(CONVERT(TIME,M.RecordTime)) from Record M where M.IdUser=A.IdUser and CONVERT(DATE,M.RecordTime,102) = CONVERT(DATE,C.RecordTime,102) and DATEPART(WEEKDAY,M.RecordTime) = (DATEPART(WEEKDAY,C.RecordTime))) END As [Registro Salida] FROM User A INNER JOIN Department B ON A.IdDepartment = B.IdDepartment INNER JOIN Record C ON A.IdUser = C.IdUser INNER JOIN UserShift E ON A.IdUser = E.IdUser INNER JOIN Shift D ON E.ShiftId = D.ShiftId INNER JOIN ShiftDetail F ON E.ShiftId = F.ShiftId WHERE A.IdUser = '5516' --GROUP BY B.IdDepartment, B.IdParent, A.IdUser, A.Name, B.Description, /*CONVERT(DATE,C.RecordTime,102), (DATEPART(WEEKDAY,C.RecordTime))*/

const SelectInput = (props) => (
<Select
  {...props}
  value={props.input.value}
  onChange={(value) => props.input.onChange(value)}
  onBlur={() => props.input.onBlur(props.input.value)}
  options={props.options}
 />
);