【发布时间】:2013-12-28 11:35:54
【问题描述】:
我有来自三列的结果
GameDate SALES PRIZES
2013-10-22 2720931 2464831
2013-10-23 3263324 3212128
2013-10-24 2662691 2484328
2013-10-25 4530379 4487401
2013-10-26 1902184 1835012
2013-10-27 2145961 1948877
2013-10-28 1059279 935004
2013-10-29 2493122 2244758
2013-10-30 3309022 2987442
我用这个得到它
select
cast(CurrentDate - 7.0/24 as date) as GameDate,
SUM(TotalBet) as SALES, SUM(TotalWin) as PRIZES
from
play WITH (nolock)
where
CurrentDate > '10/1/2013 00:00:00' and CurrentDate < '10/31/2013 00:00:00'
group by
cast(CurrentDate - 7.0/24 as date)
order by
1;
我想让结果有两位小数,并且无法弄清楚他要转换或转换语句来做到这一点。
【问题讨论】:
-
假设你尝试过
CAST(SUM(TotalBet) AS DECIMAL) as SALES?
标签: sql sql-server-2008 date sum decimal