view raw
LD16 LD16 - 11 months ago 104
SQL Question

SQL Server -Order BY

I have a field in table that is varchar(12), however data in that field is a date - 1/1/2016 (I have about 5,000 dates). I've been trying to do an ORDER BY but it doesn't seem to order by the date. How would I go about doing ORDER BY on that field if it's not a DateTIME field??



Order by cast(Field as datetime)