Order a numeric field

  • Hi Guys,

    Is there a was I can order a numberic field numerically?

    For example

    14

    76

    95

    99

    117

    131

    Instead of

    117

    131

    14

    76

    95

    99

    Thanks

  • Select <FieldName>

    FROM

    <TableName>

    ORDER BY

    <FieldName> ASC

     

    Prasad Bhogadi
    www.inforaise.com

  • Sorry for some reason the field was a varchar field which only contains numbers which is why the sort order was incorrect.

    I will cast it as an int to sort this out.

  • I assumed so that it could be a VARCHAR, makes sense to change the datatype to desired format unless you really forsee a condition where it has potential need to save VARCHAR DATA.

     

    Prasad Bhogadi
    www.inforaise.com

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

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