Numbering

  • Thread starter Thread starter Warren Kelley
  • Start date Start date
W

Warren Kelley

I have a strang issue I am querying data through ODBC on a sql 2K database
looking at it with Access XP. the number field is showing 1 then 10, 11, 12
then 2, 3 ,4, on sort ascending.
I need it to show 1, 2, 3, 5,6,7,8,9,10,11

I know there ia a sql code that will allow it but when I enter it it comes
back not proper syntax. Does someone have a better solution?

thanks
 
Hi,


You have an alphanumeric order. "azzz" come before "b", so "1999"
come before "2", when they are strings ( a=1, b=2, z=9 )... but when
printed, you don't have the " anymore.


Hoping it may help,
Vanderghast, Access MVP
 
Try Sorting by Val(YourField).

If you are using the query grid
Field: Expr1: Val(YourField)
Show: No
Sort By: Ascending

In SQL
SELECT ...
FROM ...
WHERE ...
ORDER BY Val(YourFieldName)
 
You are looking at a Text Field, or at least Access thinks it is

Try sorting on Clng(Fld)
 
Back
Top