79118541

Date: 2024-10-23 15:13:48
Score: 1.5
Natty:
Report link

The problem here was that there were three different forms of the date(time) string included in the Registration Date column:

MM/DD/YYYY

MM/DD/YYYY H:mm:ss

MM/DD/YYYY H:mm

The first step was to use replace to get rid of the time portion of the string. I used this query (or versions thereof) to get rid of the TIME:

UPDATE arizona_oct24_vr

SET RegistrationDate = REPLACE (RegistrationDate, '0:00:00', '');

NOTE: REPLACE was done with UPDATE and REPLACE is case sensitive.

Then to convert the text date into a DATE in my regdate column, I used this query: UPDATE arizona_oct24_vr

SET regdate=DATE(STR_TO_DATE(RegistrationDate, '%m/%d/%Y'))

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Benny White