|
Question : Controlling order of columns in cross tab report
|
|
I am back into the Crystal Reports XI R2 Designer again (after a very long layoff) and I am trying to make my first-ever cross tab report. To model the data, I made a query in SQL Server 2000 and saved the results into a table for use in this Designer (ultimately, I will push the data in programmatically with the SetDataSource method ). My query is as follows:
SELECT LEFT(DATENAME(MONTH,SaleMnYear),3) as Mon , Year(SaleMnYear) AS [Year] , Sum(Nbr_MTG) As Mortgages , Month(SaleMnYear) as MM FROM dbo.LoanMaster M WHERE SaleMnYear BETWEEN '01/01/2001' AND '12/31/2006' GROUP BY SaleMnYear ORDER BY Year, MM
A snippet of data looks like this:
Jan,2003,174486,1 Feb,2003,158085,2 Mar,2003,201815,3 Apr,2003,238312,4 May,2003,262511,5 Jun,2003,257584,6 Jul,2003,268387,7 Aug,2003,261993,8 Sep,2003,247333,9 Oct,2003,247349,10 Nov,2003,194391,11 Dec,2003,221340,12 Jan,2004,170862,1 Feb,2004,181557,2 Mar,2004,244025,3 Apr,2004,259659,4
Using the cross tab wizard, I have dragged the MON column of the data into the column header and the order of columns displayed is based on the sort order of the string in the data. That is, the left most column is APR, then AUG, etc. How do I display the MON column in the rpt but order the data columns in proper sequence based on the MM column (so that column titles are JAN, FEB, ...., DEC ? Thanks.
|
|
Answer : Controlling order of columns in cross tab report
|
|
Sorry. I did it in Crystal myself then mistranslated it to you
Use Column = MM (the integer) not MOn the string
mlmcc
|
|
|
|