View Full Version : Ordering querie fields


deejay_totoro
04-16-2004, 06:00 AM
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

namliam
04-16-2004, 06:07 AM
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

deejay_totoro
04-16-2004, 07:13 AM
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

namliam
04-20-2004, 01:12 AM
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