Access sorting numbers

  • Thread starter Elaine Tribelli
  • Start date
B

bhicks11 via AccessMonster.com

Elaine,

Sounds like the data type of the field is text. In your query, create an
additional sort column by converting the text field [whatevername] to a long
interger with the Access function Clng() then sort the column.

Here is how:
MyNumericField:Clng([whatevername])

It should sort numerically.

Bonnie
http://www.dataplus-svc.com
 
V

vanderghast

Your data type is probably STRING, rather than being numerical (integer,
float, decimal). Indeed, as STRING, the order is a, ay, ayyy, az, b ...
and 1, 10, 102, 19, 2, ... (ie, all those starting with the letter 'a',
.... all those starting with the character "1", ... etc)

Change you data type to a numerical one, or order on VAL(
yourFieldOrExpressionBeingString ), that second alternative being slower, at
execution time.


Vanderghast, Access MVP


in message
news:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top