I want to do some typecasting in data store and save it in new column . For example I import the excel and it read the date as varchar,if I change its data type as date then the value shows as 00-00-0000 , I want to do typecast for entire column and save it in a new column so that i will use the latestcolumn for query entity. Please help me on this
Discussion posts and replies are publicly visible
Hi wenodh,
The primary recommendation would be to format the excel date column to the format "yyyy-mm-dd".
If that's not possible in your case, then you can use the below sample query to transform the data once it is imported(I assumed your DB as MySQL)
SELECT DATE_FORMAT( STR_TO_DATE(`DateInText`, '%d-%m-%Y'), '%Y-%m-%d' ) FROM Table;