sql server - How to order by date when the column is not date formatted? -


the database i'm querying has user table column containing date user registered website.

the date entered varchar column without proper date formatting this:

apr 18 2013 12:27pm 

when select max (datecolumn) value half way across range of dates. i've considered using substrings grab year, month, date , order them in sequence. problem dates days starting 0 shortened 1 character this:

may 1 2013 12:27pm 

is there simple way find highest date, without altering database structure?

try select max(convert(datetime, datecolumn, 109))

further information on converting between datatypes in sqlserver (including date formats) here.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -