I am having a problem,
I need to ORDER BY a "Reference number" field in my MS SQL DB,
The only problem is, it is a varchar as it contains ref#'s like 1a, 22b, 43c.
Obviously, with a straight ORDER BY I get a sort like 1, 10, 11a, 11b, 2, 21, etc
I tried "CAST(SUBSTRING(ref, 1, 2) AS Integer)", however the lengths of the strings are different, theirfor I will get an error, "Can't convert 8a" etc.
Any ideas on how I can sort this properly?
big.nerd