I'm trying to sort a column that has alpha numeric values, I found this code on another post and when I execute it I'm getting an error.
This is my query:
SELECT
pmno, enrollno, membername, addr, photo,
CAST(insdate AS DATE) AS reg_date
FROM
dbo.Member
WHERE
CAST(insdate as DATE) < '2020-01-20'
AND court_name = 'City Court Unit'
ORDER BY
LEFT(pmno, PATINDEX('%[0-9]%', pmno) - 1), -- alphabetical sort
CONVERT(INT, SUBSTRING(pmno, PATINDEX('%[0-9]%', pmno), LEN(pmno))) -- numerical