Sorting in SQL
It’s not completely uncommon to come across databases set to use collations and/or code pages where the ORDER BY clause won’t sort as expected; e.g. Åke might be sorted before Carl. A quick fix to this is to use either the CAST()- or the CONVERT()-function on the text field you wish to sort by. I tend to use CAST() since it’s ANSI standard. However, CONVERT() works with all data types, while CAST() don’t....