Groups | Blog | Home
all groups > sql server reporting services > december 2004 >

sql server reporting services : sort correctly by month name



aaron_kempf NO[at]SPAM hotmail.com
12/16/2004 5:53:20 PM
so i have month name in a field for a rs report..

and i want to be able to sort it correctly.

what are my options?

I'm doing this in MDX: and i cant change the cube or a dimension

aaron

goinoutwest
12/16/2004 7:13:26 PM
Try sorting on the result of a "custom code" function.

The function has something like this:

Select Case Month
Case "Jan" returnValue = 1
Case "Feb" returnValue = 2
Case "Mar" returnValue = 3
etc, etc...
End

Writing Custom Code:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql2k/html/ERSCstCode.asp?frame=true


[quoted text, click to view]

Soan
12/20/2004 4:13:09 AM
Hi

I think you have something like that in your query:
,DateName( month, [Date]) as NameMonth
You have to add
,DATEPART(month, [Date]) as NumMonth

an use it for the sorting



[quoted text, click to view]
aaron_kempf NO[at]SPAM hotmail.com
12/20/2004 4:06:07 PM
yeah, im doing this in MDX not in TSQL tho

I ended up just changing the Virtual Dimension to be sorted correctly



[quoted text, click to view]

AddThis Social Bookmark Button