Order by for Ratio Dataset

  • Hi

    i am trying to arrange ratio dataset in ascending order

    example dataset looks like this

    50302136120:0:7:4

    50303835194:0:9:6

    50302786249:0:14:7

    5030264037:0:2:0

    50303753382:0:7:1

    5030213759:0:10:0

    i tried with order by ,it is not working

    is there any solution to arrange data in ascending order

  • 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?

  • hi

    i 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

  • These have to be coming back as characters. Therefore they'll be ordered as characters.

    20:1:1

    comes before

    20:2:5

    No 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.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply