New related comments
Number of comments in the last 48 hours
Location of mysql startup script
Best operating system settings for mysql throughput
Monitoring mysql status
Handling of dates in mysql (Date formats)
This article has not been rated yet. After reading, feel free to leave comments and rate it.
Question:How do I express a date in a SQL statement for the mysql database? I use version 3.23.
Answer:The format of data type DATE is 'YYYY-MM-DD'. ANSI SQL says that nothing else is allowed.
As a convinience MySQL automaticly converts the date to a number if used in a number context. It's also smart enough to allow a 'relaxed' string form when updating, but only when updating.
Below you find a few examples what works and what does not work.