Validate the datetime value: Difference between revisions
Jump to navigation
Jump to search
→Verify the value is not 0000-00-00 00:00:00
m (→MySQL approach) |
|||
| Line 5: | Line 5: | ||
== MySQL approach == | == MySQL approach == | ||
=== Verify the value is not | === Verify the value is not 1900-01-20 xx:xx:xx === | ||
Schema of column value | Schema of column value | ||
* Type: datetime | * Type: datetime | ||
* Default value: | * Default value: allow be NULL | ||
<pre> | <pre> | ||
SELECT `my_date_column` | SELECT `my_date_column` | ||
FROM `my_table` | FROM `my_table` | ||
WHERE `my_date_column` LIKE ' | WHERE `my_date_column` LIKE '1900-%'; | ||
</pre> | </pre> | ||