/ Published in: SQL

An easy way to handle null dates. If date = 0000-00-00 then null, else use date
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# Original SQL SELECT name, last_name, birthday FROM people #Modified SQL SELECT name, last_name, IF( birthday = '0000-00-00', NULL, birthday) AS birthday FROM people
URL: http://www.estadobeta.com/2008/02/12/la-fecha-0000-00-00-de-mysql/
Comments
