I’m try to order some data in a database which in it’s current format is set as dd/mm/yyyy. Is there a way I can replace the ‘/’s when selecting the results in the query?
i.e. in php i could use str_replace() and do it that way. I dont want to change the data in the table as it is used elsewhere within the site.
Yes, there is. MySQL offers plenty of string functions. Here’s a simple example of how it works:
You also should be able to alter the data type using CAST to a SIGNED or UNSIGNED integer.