Ordering querie fields

deejay_totoro

Registered User.
Local time
Today, 12:18
Joined
May 29, 2003
Messages
169
Hello,

I wonder if there is a way around how queries are ordered. For example, if I have a series of numbers such as:

1 5 10 15 20 25 30

If I use ascending order, Access will order them as:

1
10
15
20
25
30
5

How do I get queries to be ordered as:

1
5
10
15
20
25
30

Many thanks!

dj_T
 
This is due to the fact your ordering numbers in a text field...

Try adding a (invisible) field using
cdbl([YourField])
and ordering that field.... should resolve this ....

Regards
 
Val & CDbl

Hello,

thanks for the reply!

By the way - whats the difference between using:

Order By Val(YourCodeFld);

or

Order By CDbl(YourCodeFld);

I am also thinking of what happens when the field (result) contains both numbers and text. Is this a big problem?

Thanks!

dj_T
 
Last edited:
If the field contains both numbers and letters that would be a problem... i think... It would then return 0 probably...

Not much difference between val and cdbl (read the help to find out more)

Regards
 

Users who are viewing this thread

Back
Top Bottom