AS
SELECT TOP 50 *
FROM dbo.Ritten
WHERE (Status = 0)and (Afgemeld = 0)
ORDER BY CAST(Datum AS date),Tijd
输出= 13:30:00.0000000
我需要这个= 13:30
答案 0 :(得分:2)
试试这个:
SELECT CONVERT(VARCHAR(5),CAST(Datum as DateTime),108) ...
答案 1 :(得分:0)
SELECT CONVERT(CHAR(5), Datum, 8)
FROM Tijd;
答案 2 :(得分:0)
您不需要Seconds
值吗?
SELECT convert(varchar(15), getdate(), 114)
-- (will return HH:mm:ss:mmm format [24 hr])
所以在您的查询中:
SELECT SUBSTRING(convert(varchar(15), CAST(Datum as DateTime), 114),1,5) as DateString
-- this will return HH:mm format