I have a table in SQL Server 2008 with a MessageTimestamp column of type varchar(50) instead of datetime. I would like to get data from this table between two dates.
Normally, if the column was datetime, I would use a query like:
select *
from myTable
where MessageTimestamp >= @firstDate and MessageTimestamp <= @lastDate
However, I cannot use this right now since this is varchar. I need a way as easy as possible to get those data rather than updating the column type. Any suggestion would be appreciated.
Edit: example date format stored -> 2016-05-16 11:20:00 AM