Hello and thanks in advance,
I have a database table containing contact logs for our booking system, I want to be able to list all the logs and filter them firstly by Status and then order those by their follow up date
I have tried a variety of the following but whilst is sorts by Status the dates seem to be in a random order. I've used -STR because some do not have dates and I want those to be put at the bottom of the order, and STR_TO_DATE becuase I'm using UK dates and a varchar field.
sql = "SELECT * FROM contact_log ORDER BY CL_Status, -STR_TO_DATE(CL_FU_Date, '%d/%m/%Y') DESC"