| Databases InterBase (28) MS-SQL (5) mysql (36) Oracle (1) |
Handling of dates in mysql (Date formats)
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.
Comments:
|