Tuesday, 15 January 2013

SQL Server : pivot date to month quarter and year subtotal format -


I have a table that contains datefield and product . I want to query the pivot of the total to show total total, quarter total and year total.

  Year Month ABC ----------------- 2014 January 2014 February 2014 Q 2014 2014 May 2014 June 2014 Q 2014 2014 July 2014 September 2014 Q3 2014 October 2014 November 2014 December 2014 Q4 2014 Total 2015 January 2015 February 2015 March 2015 Q1 

See it from CodeProject , the code given in the example is similar to your requirement.


No comments:

Post a Comment