Displaying numbers

D

DM

How do you display a list of numbers sequentially;i.e.,
1,2,3,4...9,10,11...20,21,22, etc. rather than 1, 10,
100,2, 20, 200, etc.

Also, how do you display the leading zero so 1 becomes 01?
 
D

Douglas J. Steele

The reason it's sorting 1, 10, 100 is because they're stored as text, not
numbers. Convert them to numbers and they'll sort properly. If you need to
leave them as text, add a computed field to your query that uses the Val
function to convert them to numbers, and sort on that computed field rather
than the original field.

If they're numbers, you can't store leading zeros. However, you can use the
Format property to display preceding zeros. If you want 01, you'd specify 00
as the format. If you want 001, you'd specify 000 as the format.

If you leave them as text, then you can store the leading zeros.
 
Top