It depends upon the coding. You can manage it by using if else statement. If you declare it as a char type, the result: 1, 10, 11, 12 ..... but for numbers, the result: 1,2,3,4......
IF they are REALLY numbers. It doesn't matter, and they will show in the correct numeric order with or without a leading zero
HOWEVER
If they are strings of number characters you will need a leading zero as then they will be sorted in ASCII value order.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
You have to change the field type to Numeric in database. This is resolve the sorting issue when browsing the products on web interface.
If you are using the MS Access database then you will have to change the field type in database and if MS Sql then you can convert the field type in sql query.
__________________
Zeeshan Dar
itHighway - Please login or register to view this content. Registration is FREE | Please login or register to view this content. Registration is FREE
Last edited by chrishirst; 08-18-2008 at 03:56 AM..
Reason: followon post merged
If the column type is Numeric(Integer) then it will give you the results as 1,2,3.. etc and If you have column type Text(Varchar) then it will give you the results as 1,10,2,3... etc
Chris Hirst has the right answer. As strings, it goes 1, 2, 20, 25, 3, 35, 4, and so on. If you sort them as numbers, you'll avoid this, and if you must sort them as strings, prefix them to a set width, as 001, 002, 020, and so on.