Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

No sure how to go about this please see for more details

$
0
0

I wrote below query to get result in-terms of year,quarter wise

SELECT
YEAR(OrderDate) AS OrderYear,
SUM(CASE WHEN DATEPART(Q,OrderDate)=1 THEN TotalDue ELSE 0 END) AS Quater1,
SUM(CASE WHEN DATEPART(Q,OrderDate)=2 THEN TotalDue ELSE 0 END) AS Quater2,
SUM(CASE WHEN DATEPART(Q,OrderDate)=3 THEN TotalDue ELSE 0 END) AS Quater3,
SUM(CASE WHEN DATEPART(Q,OrderDate)=4 THEN TotalDue ELSE 0 END) AS Quater1
FROM Sales.SalesOrderHeader
GROUP BY YEAR(OrderDate)

Below is the query result

OrderYear   Quater1               Quater2               Quater3               Quater1
----------- --------------------- --------------------- --------------------- ---------------------
2004        14170982.5455         17969750.9487         56178.9223            0.00
2001        0.00                  0.00                  5850932.9483          8476619.278
2002        7379686.3091          8210285.1655          13458206.13           10827327.4904
2003        8550831.8702          10749269.374          18220131.5285         16787382.3141

The same thing i am trying to achive using SSIS.Bit baffled how to go about this.


Smash126


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>