converting text to datetime
Posted on 2014-04-11
I the following string in a sql select query:
Convert(varchar(12),DeadlineDate,107)+" "+Convert(varchar(5),DeadlineTime, 108) Deadline
this is merging a date and time from the two datetime fields to provide a single formatted datetime on a web page.
I am being asked to order on this end datetime (Deadline) which is causing me problems since it is now text. Can I convert the result back to a datetime somehow?