I have a field that’s in datetime format when date would be better and more consistent with the rest of the database, so I want to convert. The time part is all 00:00:00 anyway.
How can I do this in MySQL?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want this in a
SELECT-Statement, just use theDATEOperator:If you want to change the table structurally, just change the datatype to
DATE(of course only do this if this doesn’t affect applications depending on this field).Both will eliminate the time part.