What is an appropriate value to store in a DATE MySQL variable if only month and year are known? -
suppose have mysql variable date_stored
of date datatype. have month , year particularly date data stored in date_stored
. no day information given. there guidelines on store in date_stored
if month , year known?
mysql manual says partial dates can stored. month , day ranges specifiers begin 0 because mysql permits incomplete dates storing such '2015-00-00'
or '2015-10-00'
. http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date-format
so if day part not given can still store yyyy-mm-00
e.g '2015-10-00'
also see below related posts.
store incomplete date in mysql date field
Comments
Post a Comment