Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Order error
Mon, Dec 22 2008 12:25 PMPermanent Link

Francisco Fernandez
Hi.

I have a table called ARTICULOS with a field CODIGO, Varchar(20), Collation ESP.

I have two records with the values "CT" and "CH" in field CODIGO.

If I execute SELECT * FROM ARTICULOS ORDER BY CODIGO the row with "CT" value appears
before value "CH"

If I change collation with ANSI works fine

Thank you
Mon, Dec 22 2008 2:41 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Francisco,

<< I have two records with the values "CT" and "CH" in field CODIGO.

If I execute SELECT * FROM ARTICULOS ORDER BY CODIGO the row with "CT"
value appears before value "CH"

If I change collation with ANSI works fine >>

The traditional Spanish collation under Windows treats CH as one character:

http://msdn.microsoft.com/en-us/library/cc709428(VS.85).aspx

To force an ANSI comparison instead, use this:

SELECT * FROM ARTICULOS ORDER BY CODIGO COLLATE ANSI

--
Tim Young
Elevate Software
www.elevatesoft.com

Image