Sorting issue for numbers

  • Hi All,

    I kept sorting for S.No in my report. While i'm sorting the numbers are sort in 1,10,100,2,20,3,30 order but i want 1,2,3,10,20,30,100. Please help me to solve this issue

    -----------------------------------------------------------------------------------------------------------------------------------------------------------
    Please feel free to let me know if you are not clear or I’ve misunderstood anything.

    Thanks,
    Arunkumar S P

  • It looks like the numbers are stored in a Char/Varchar column.

    Convert them to an Integer then sort by the Integer data.

  • Thanks for your quick respone. Where to convert ? . In sql(dataset) or by using expression.

    -----------------------------------------------------------------------------------------------------------------------------------------------------------
    Please feel free to let me know if you are not clear or I’ve misunderstood anything.

    Thanks,
    Arunkumar S P

  • It depends, it you are only storing Numbers in the column then the datatype should be really a Numeric data type.

    Otherwise i would do a conversion on the stored procedure/ View that you use to access the data.

  • Thanks Steveb . Its working

    -----------------------------------------------------------------------------------------------------------------------------------------------------------
    Please feel free to let me know if you are not clear or I’ve misunderstood anything.

    Thanks,
    Arunkumar S P

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

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