Hi,
thanks for the reply i tried your way but it is giving error , may be because our date variable is in the Mmm-yyyy format , and not in complete date format.
Hi ,
Thanks for all your responses, it is working now but one problem ,it is sorting correctly for one year but in case it is dec-2007 and jan-2008 then jan-2008 is coming first.
How to fix this .This is the formula i am using right now.
=FormatDate(ToDate([Short Month Year];“Mmm-yyyy”);“MM-yyyy”)
The reason of wrong sorting is your variable is string type, formatdate function will return string value. You just need to change it to date, somthing like this:
=ToDate(FormatDate(ToDate([Short Month Year];“Mmm-yyyy”);“MM-yyyy”);“MM-yyyy”)
Infact if your your universe object is already in Mmm-yyyy format (Date type) you can use below variable:
=ToDate(FormatDate([Short Month Year];“MM-yyyy”);“MM-yyyy”), this one should work perfectly.
I want to sort the date object in the order the following order
Ex:
Jan 08
Jan09
Feb 08
Feb09
Mar 08
Mar09
And I dont want to use the CUSTOM SORT option for this.
Basically if you date-sort, you’ll get
jan 08, feb 08, mar 08, jan 09, feb 09, mar 09
If you text-sort, you’ll get
feb 08, feb 09, jan 08, jan 09, mar 08, mar 09
So you might be better off splitting into two variables - a month and a year separately. have them as dates and sort by month, then year. That should work.
You can get Bob to do this automatically for you in Deisgner by clicking the Automatic Time Hierarchy button on the object’s properties. This is the easiest way to do it, but if you can’t do it in Designer, create report-level variables instead.
ok fine… Now tell me that if i write free-hand sql for this object (in a separate dateprovider) or in the present dataprovider it self i write the code for the required date format will it work?
Check the option: “Do not Generate SQL”. And then modify the query as per your requirement. It will definately work. But there is a disadvantage of this solution: Whenever you will add or delete any object, the query will automatically be modified.
Also if possible for you, can you help us with the screenshot of your issue…