I have a DATE column with dates in 2012-02-25 format. I need to update it to 12-02-25 but am not sure how to go about it?
Thanks!
Edit: After reviewing all the answers, it seems I have not been clear enough. I do not wish to change my type, nor do I wish to play with the output. I want to update the existing date column from 2012 to 12. It should be an UPDATE query if anything, I’m just not sure how to write it. Thanks for all the comments so far.
Edit 2: It seems my question did not make sense, I was not aware you could not store DATE as xx-xx-xx. Thanks anyhow!
It’s not possible to store date in this format
'12-02-25'in column havingDATEas datatype. You can store it in column having data type asCHAR(8)and then use followingUPDATEquery:but better approach would be to store it in
DATEformat only and useDATE_FORMATfunction while retrieving the data from table.