Then your field must not be numeric...its the only answer. ordering a query
by a numeric field will do just that...order them numerically

i ran a loop to poulate a database with random numbers between 1-1000
it mixed them up rather nicely

when i use the query below. it sorts them just right....
but changin the field to text does what ur explaing because they arent
really numbers anymore, they are text and all entries with 1 in front of
them are gonna come before entries with 2 at the beginning

  <cfquery name="numbers" datasource="#request.maindsn#">
  select * from tbl_numbers
  order by number
  </cfquery>

if you dont want to change the field to numeric then use ORDER BY VAL(Field)
(dunno if this works in anything other than msaccess)

hope it helps. goodluck...

----- Original Message -----
From: "Jillian Carroll" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, January 23, 2003 10:53 AM
Subject: RE: Sorting Numbers


> It's not working that way... it does: 1, 10, 100, etc. instead of 1, 2,
> 3, 4, and so on.
>
> > -----Original Message-----
> > From: Ewok [mailto:[EMAIL PROTECTED]]
> > Sent: January 23, 2003 8:24 AM
> > To: CF-Talk
> > Subject: Re: Sorting Numbers
> >
> >
> > if the field's data type in the table is numeric then you can
> > just order your query by that field?
> >
> > ----- Original Message -----
> > From: "Jillian Carroll" <[EMAIL PROTECTED]>
> > To: "CF-Talk" <[EMAIL PROTECTED]>
> > Sent: Wednesday, January 22, 2003 6:24 PM
> > Subject: RE: Sorting Numbers
> >
> >
> > > Sorry, I mis-spoke (hazard of using a word with double meanings).
> > >
> > > I need to sort the results of a query in this way.
> > >
> > > > -----Original Message-----
> > > > From: Everett, Al [mailto:[EMAIL PROTECTED]]
> > > > Sent: January 22, 2003 5:04 PM
> > > > To: CF-Talk
> > > > Subject: RE: Sorting Numbers
> > > >
> > > >
> > > > What you've got there is an ASCII sort.
> > > >
> > > > You want a numeric sort.
> > > >
> > > > ListSort(myList,"numeric")
> > > >
> > > > > -----Original Message-----
> > > > > From: Jillian Carroll [mailto:[EMAIL PROTECTED]]
> > > > > Sent: Wednesday, January 22, 2003 5:51 PM
> > > > > To: CF-Talk
> > > > > Subject: Sorting Numbers
> > > > >
> > > > >
> > > > > How do I sort a list so that it doesn't do this:
> > > > >
> > > > > 1
> > > > > 2
> > > > > 3
> > > > > 4
> > > > > 5
> > > > > 6
> > > > > 7
> > > > > 8
> > > > > 9
> > > > > 10
> > > > > 100
> > > > > 101
> > > > > 102
> > > > > 103
> > > > > 104...
> > > > >
> > > > > I want 11 to come after 10.
> > > > >
> > > > > Thanks!
> > > > >
> > > > > --
> > > > > Jillian
> > > > >
> > > > >
> > > >
> > >
> >
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to