I am querying this
UPDATE maindb SET date = CAST(date as DATETIME) WHERE date LIKE'%1974%'
so I'm expecting a result of
date
1974-12-12
1974-12-13
1974-12-14
However when I query
select * from maindb where date like '%1974%'
The result is all like this
May 28 1974 12:00AM
Why is this? I remember query something like this
SET *Some code i forgot* 120
How can I set back?
EDIT:
For the record my date
column is in varchar(20)
I don't know why but the company wants it to a new database/normalize and have 100k records. I learned that if all the data in the date
column is set to yyyy-mm-dd
format, you can change the column to datetime