#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    3
    Rep Power
    0

    Problem with ordering of numbers (ORDER BY)


    Hi

    I have the following problem. I am retreiving chapternumbers from a database, and want to sort them in ascending order. Using the "ORDER BY fieldname ASC" works fine until i get subchapters. These subchapters are like this:
    1.1
    1.2
    1.3a
    1.3b
    etc...

    So far the sorting is fine. However, when i get ten or more subchapters like 1.10, 1.11, 1.12 etc, it seems to be registered like 1.1, and end up at the top like this:

    1.1
    1.10
    1.11
    1.12
    1.2
    1.3
    etc..

    Anybody that knows a solution to this problem. (My site is created with ASP)
  2. #2
  3. Digitally Challenged
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    280
    Rep Power
    12
    try listing your chapter number like this as text
    1.01
    1.02
    1.03
    1.04
    1.05
    1.06
    1.07
    1.08
    1.09
    1.10
    My brain cells are like a storm trooper's armor: useless

IMN logo majestic logo threadwatch logo seochat tools logo