Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Clukey #1
1 2 3 4 5 Not 1 10 11 12 13 14 15
Hy, I have created a recordset and have numbered the enteries in a specific
column, and I want the records to show in order (i.e. 1, 2, 3, 4, 5 ... 8, 9,
10, 11, 12), but when I sort the recordset it shows like this 1, 10, 11, 12,
13, ... 18, 19, 2, 20, 21, 22, ect. How do I get it to show the records in the
correct order, Thanks.
Clukey Guest
-
Chris In Madison #2
Re: 1 2 3 4 5 Not 1 10 11 12 13 14 15
I'm betting that your numbers are being stored in a text field in the
database... Am I right? If so, can you change the datatype to INT?
Best regards,
Chris
Chris In Madison Guest
-
darrel #3
Re: 1 2 3 4 5 Not 1 10 11 12 13 14 15
> Hy, I have created a recordset and have numbered the enteries in a
specific9,> column, and I want the records to show in order (i.e. 1, 2, 3, 4, 5 ... 8,12,> 10, 11, 12), but when I sort the recordset it shows like this 1, 10, 11,the> 13, ... 18, 19, 2, 20, 21, 22, ect. How do I get it to show the records inUse integers instead of text strings.> correct order, Thanks.
-Darrel
darrel Guest
-
Tom Muck #4
Re: 1 2 3 4 5 Not 1 10 11 12 13 14 15
"Clukey" <webforumsuser@macromedia.com> wrote in message
news:d6aqpl$nml$1@forums.macromedia.com...specific> Hy, I have created a recordset and have numbered the enteries in a9,> column, and I want the records to show in order (i.e. 1, 2, 3, 4, 5 ... 8,12,> 10, 11, 12), but when I sort the recordset it shows like this 1, 10, 11,the> 13, ... 18, 19, 2, 20, 21, 22, ect. How do I get it to show the records inYour fields are stored as text instead of numbers, as was pointed out, but> correct order, Thanks.
if you can't change the data type for whatever reason you can order it by
using a sql keyword. You didn't say what kind of database, but here is code
for two of them:
SQL Server:
SELECT ID, blah from MyTable
ORDER BY CAST(ID as int)
Access:
SELECT ID, blah
FROM MyTable
GROUP BY id, blah
ORDER BY sum(ID);
--
--
Tom Muck
co-author Dreamweaver MX 2004: The Complete Reference
[url]http://www.tom-muck.com/[/url]
Extending Knowledge Daily
[url]http://www.communitymx.com/[/url]
Tom Muck Guest
-
Clukey #5
Re: 1 2 3 4 5 Not 1 10 11 12 13 14 15
Hey, I changed the field to INT and it fixed it. Thanks
Clukey Guest



Reply With Quote

