I have a SQL table where one of the columns 'creator' is a VARCHAR data type. That column stores values like this one: Mike Jones|05-17-2015 1:21 pm
consisting of the person that created the record, the date and time it was created.
I need to use the date portion of that varchar data to form a SQL query, so that we can generate a list of tickets created between two dates. We can't restructure the table easily so i'm stuck working this out in its current format, otherwise we just would have added a CREATED date field and compared on that.
The SQL being attempted is this:
SELECT
ticknumb,
cnames,
creator,
ticktype,
tickstatusFROM
aticketsWHERE
creator>= '%05-24-2015%' AND
creator<= '%05-30-2015%' AND
tickstatusNOT LIKE 'Closed,Complete'
Is there a way to do this directly within the SQL query without having to to a looped explode in the php first to extract and compare the earliest / latest dates?