I currently have a column ('kWhdate') in a view ('appdatatest') that takes a timestamp column and converts it to a date.
date_format(`t`.`value_timestamp`,'%d/%m/%y%y') AS `kWhDate`
The above is part of the Create View query. It is currently stored as VARCHAR(10). I would like to convert it to a Date. I have tried the following:
ALTER VIEW appdatatest MODIFY appdatatest.kWhDate datetime
SELECT STR_TO_DATE(appdatatest.kWhDate, Date) FROM appdatatest
I have looked at this question Is it possible to change the datatype of a column in a view? but it gives an answer for SQL Server not MYSQL
If possible I could convert in the original CREATE VIEW query
Thanks