Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 Order by for Ratio Dataset Rate Topic Display Mode Topic Options
Author
 Message
 Posted Thursday, September 03, 2009 7:10 AM
 Grasshopper Group: General Forum Members Last Login: Tuesday, May 11, 2010 11:50 PM Points: 15, Visits: 46
 Hii am trying to arrange ratio dataset in ascending orderexample dataset looks like this50302136 120:0:7:450303835 194:0:9:650302786 249:0:14:750302640 37:0:2:050303753 382:0:7:150302137 59:0:10:0i tried with order by ,it is not working is there any solution to arrange data in ascending order
Post #782130
 Posted Thursday, September 03, 2009 9:09 AM
 SSC-Dedicated Group: Administrators Last Login: Yesterday @ 5:35 PM Points: 32,276, Visits: 14,532
 I'm not sure what I'm looking at here. What are the data types? Is the ratio a char field? If so, then it is ordered as characters.What ordering are you trying to get, or what are the rules for ordering your ratios? Follow me on Twitter: @way0utwestForum Etiquette: How to post data/code on a forum to get the best help
Post #782277
 Posted Thursday, September 03, 2009 9:22 AM
 Grasshopper Group: General Forum Members Last Login: Tuesday, May 11, 2010 11:50 PM Points: 15, Visits: 46
 hii am having ratio values as output from proc for example (20:2:1)i want arrange this values in ascending order or in descending order
Post #782288
 Posted Thursday, September 03, 2009 9:30 AM
 SSC-Dedicated Group: Administrators Last Login: Yesterday @ 5:35 PM Points: 32,276, Visits: 14,532
 These have to be coming back as characters. Therefore they'll be ordered as characters.20:1:1comes before 20:2:5No matter what the math, these are ordered by characters. If you have some rules, you could use charindex and substring to strip out the individual numbers and possibly find a way to order them, but the rules for reducing these to the lowest values would be complex.Again, if you develop the rules that you need for ordering these, we might be able to help. Follow me on Twitter: @way0utwestForum Etiquette: How to post data/code on a forum to get the best help
Post #782298

 Permissions