Forum Moderators: open

Message Too Old, No Replies

Sort by ASC in Select statement question

         

kevinj

2:50 pm on Sep 29, 2003 (gmt 0)

10+ Year Member



I have the following Select statement:

set RS = DBMusicLists.execute("SELECT * FROM concert_selections ORDER BY TITLE ASC")

My problem is that I have a few records that include ... in the title and they are appearing at the top of the sort:

For Precious Friends Hid In Death's… (6)
MAILMAN
Ludwig

In Spring…When Kings Go Off To War (5)
HOLSINGER

Ludwig…and the mountains rising nowhere (6)
SCHWANTNER
Helicon

17th Century Italian Suite (3)
CACAVAS
Belwin

1812 Overture (5)
TCHAIKOVSKY / Hindsley
Hindsley

1812 Overture (5)
TCHAIKOVSKY / Lake
Carl Fischer

Can anyone think of something that would make sure the first 3 records are alphabetized correctly?

Thanks.

mattglet

4:05 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



that is totally strange. i really thought that ORDER BY only looked at the first character in the string. i wouldn't think that an ellipse (it's what the ... is called :) ) would have any bearing. i will be interested to here anyone else's opinion.

-Matt

skipfactor

4:12 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Aren't the first 3 records already ordered alphabetically by title?

For Precious Friends Hid In Death's… (6)

In Spring…When Kings Go Off To War (5)

Ludwig…and the mountains rising nowhere (6)

mattglet

5:00 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yeah, but then the list goes to:

17th...
1812...

the top 3 on the list should be down the list.

-Matt

skipfactor

5:23 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Running this query from DW on an Access DB with the TITLE col called 'Delete' & set as a 'Text' Data Type, I get this sort:

SELECT * FROM concert_selections ORDER BY Delete ASC

17th Century Italian Suite (3)

1812 Overture (5)

1812 Overture (5)

For Precious Friends Hid In Death's… (6)

In Spring…When Kings Go Off To War (5)

Ludwig…and the mountains rising nowhere (6)

What brand of DB are you using?

kevinj

5:33 pm on Sep 29, 2003 (gmt 0)

10+ Year Member



I'm using an Access 2000 db.

skipfactor

5:41 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In design view for the 'concert_selections' table, is the 'Data Type' for TITLE set to 'Text'?

sun818

7:07 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Do you have a space (or a hidden character) in front of those three records? You might have to look at the data from a hex editor. Copy the title into a text file, then use a hex editor like xvi32 (freeware) to take a look at the text file.

kevinj

7:21 pm on Sep 29, 2003 (gmt 0)

10+ Year Member



Yes, the field's datatype is text. There's no hidden character in front of the titles.

kevinj

7:29 pm on Sep 29, 2003 (gmt 0)

10+ Year Member



I just received an email from my client who gave me the complete titles for them so I've removed the ... and it works fine. Not sure what the problem was. Thanks for your help everyone.