0
我有三列SQL Server 2008中嘗試將varchar爲十進制
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)爲十進制)爲SALES'? –