{"id":4950,"date":"2012-05-30T10:39:07","date_gmt":"2012-05-30T10:39:07","guid":{"rendered":"http:\/\/phpcodez.com\/?p=4950"},"modified":"2012-05-30T10:39:07","modified_gmt":"2012-05-30T10:39:07","slug":"sql-date","status":"publish","type":"post","link":"http:\/\/phpcodez.com\/sql-date\/","title":{"rendered":"SQL DATE()"},"content":{"rendered":"<p>SQL DATE() function extracts the date part of a date.<\/p>\n<p><strong>Table \u00a0&#8211; orders<\/strong><\/p>\n<p>+&#8212;&#8211;+&#8212;&#8211;+&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br \/>\n| oid | uid | items | date \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|<br \/>\n+&#8212;&#8211;+&#8212;&#8211;+&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br \/>\n| \u00a0\u00a01 | \u00a0\u00a01 | AAAA \u00a0| 2007-05-16 00:00:00 |<br \/>\n+&#8212;&#8211;+&#8212;&#8211;+&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<\/p>\n<p><strong>Example<\/strong><\/p>\n<p>mysql&gt; SELECT DATE(date) as bill_date from orders ;<br \/>\n+&#8212;&#8212;&#8212;&#8212;+<br \/>\n| bill_date \u00a0|<br \/>\n+&#8212;&#8212;&#8212;&#8212;+<br \/>\n| 2007-05-16 |<br \/>\n+&#8212;&#8212;&#8212;&#8212;+<br \/>\n1 row in set (0.00 sec)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL DATE() function extracts the date part of a date. Table \u00a0&#8211; orders +&#8212;&#8211;+&#8212;&#8211;+&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+ | oid | uid | items | date \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0| +&#8212;&#8211;+&#8212;&#8211;+&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+ | \u00a0\u00a01 | \u00a0\u00a01 | AAAA \u00a0| 2007-05-16 00:00:00 | +&#8212;&#8211;+&#8212;&#8211;+&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+ Example mysql&gt; SELECT DATE(date) as bill_date from orders ; +&#8212;&#8212;&#8212;&#8212;+ | bill_date \u00a0| +&#8212;&#8212;&#8212;&#8212;+ | 2007-05-16 | +&#8212;&#8212;&#8212;&#8212;+ 1 row &hellip; <a href=\"http:\/\/phpcodez.com\/sql-date\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">SQL DATE()<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[213,332,370,392,457,461],"class_list":["post-4950","post","type-post","status-publish","format-standard","hentry","category-sql","tag-functions","tag-mysql","tag-php","tag-query","tag-sql","tag-statement"],"_links":{"self":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/4950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/comments?post=4950"}],"version-history":[{"count":0,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/4950\/revisions"}],"wp:attachment":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/media?parent=4950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/categories?post=4950"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/tags?post=4950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}