我正在使用 SQLServer2008。
SELECT Amount ,
OpportunityCloseDate
FROM dbo.OpportunityMaster AS om
输出是:
Amount OpportunityCloseDate
------------------------------------
25458.00 2012-07-02 00:00:00.000
54555.00 2012-08-16 00:00:00.000
2154.00 2012-08-21 00:00:00.000
123458.00 2013-08-31 00:00:00.000
54546.00 2013-08-28 00:00:00.000
1235.00 2013-08-22 00:00:00.000
56454.00 2013-08-22 00:00:00.000
156.00 2013-09-13 00:00:00.000
34534.00 2013-09-04 00:00:00.000
34355.00 2013-09-02 00:00:00.000
76568.00 2013-09-01 00:00:00.000
235646.00 2013-09-10 00:00:00.000
54465.00 2013-09-18 00:00:00.000
244254.00 2013-12-19 00:00:00.000
预期输出:
Amount Quarter
------------------
82167.00 Q1
671417.00 Q2
244254.00 Q3
在我的数据库中,年份从 4 月 1 日开始。我想按季度获取此数据。我不太了解季度..谢谢您的帮助..