答案 0 :(得分:0)
您可以使用dateadd()
截断时间部分,如下所示:
dateadd(day, datediff(day, 0, b.Tanggal), 0) as Tanggal
答案 1 :(得分:0)
如果“Harga”列中有一些负值,则应使用FLOOR()和CEILING()函数的组合,而不是FLOOR(Harga)。
declare @q TABLE
(
Tanggal DATETIME,
Harga MONEY
)
INSERT @q
VALUES
('2014-02-02', 1200000),
('2013-02-02', 1200000),
('2013-02-02', 1200000),
('2014-12-29 16:25:53.000', 1200000)
SELECT CAST(Tanggal AS DATE) AS Tanggal,
CAST(FLOOR(Harga) AS INT) AS Harga
FROM @q