在SQL中,我得到了总账单金额的答案 [英] In sql i got the answer of total Bill Amount
本文介绍了在SQL中,我得到了总账单金额的答案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
但是我要获取的Billdate等于今天如何从总金额中获取总金额.例子\
Billno金额Billdate
1 50 13/12/2011
1 50 13/12/2011
2 100 13/12/2011
3120 11/12/2011
4 100 11/12/2011
我想答案是150,等于今天
请有人帮忙解决这个问题
在Advance中致谢
But i want to get the Billdate is equal to today how to get the total Amount from the total Amount. Example\
Billno Amount Billdate
1 50 13/12/2011
1 50 13/12/2011
2 100 13/12/2011
3 120 11/12/2011
4 100 11/12/2011
i want the answer is 150 which is equal to today
Please Someone help for this problem
Thanks in Advance
推荐答案
尝试此查询.
Try this query.
SELECT SUM(Amount) AS 'TotalAmount' FROM [TableName] WHERE CAST(Billdate AS Date) = CAST(GETDATE() AS Date)
问候,
爱德华
Regards,
Eduard
这篇关于在SQL中,我得到了总账单金额的答案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文