In my MySQL DB table I have a column called StartDate (of varchar type) plus three separate integer columns; Day, Month, Year.
What I want to do is combine the Day, Month and Year values and insert the resulting value into the StartDate field in the format dd/mm/yy (e.g. 03/07/84).
This wouldn’t be too difficult but a lot of the Day and Month values are only one digit long, so those need to be prefixed with a 0 (e.g. 1 becomes 01, 9 becomes 09, 11 remains unaltered) in order to meet the required StartDate formatting.
The other problem is the Year field. This currently holds a 4 digit year, so the first 2 digits need to be deleted to meet the StartDate formatting (e.g. 1984 becomes 84, 2001 becomes 01).
Can anyone help work out the procedure I need to go through to achieve this.
I’m guessing I need to work on the Day, Month and Year columns first to get them in the right formatting before then copying them and adding the ‘/’ characters into the StartDate column.
Thanks a lot in advance for all help and assistance.
Try this query: