Product Solutions Support
Try MemSQL

TO_DAYS

Returns the day number of the input date object. Day number starts with 1 being 0000-01-01 and counts sequentially.

TO_DAYS ( dateobj )

Arguments

Return Type

Integer

Examples

memsql> select to_days('0000-01-01');
+-----------------------+
| to_days('0000-01-01') |
+-----------------------+
|                     1 |
+-----------------------+

memsql> select to_days('2016-03-23 08:17:01');
+--------------------------------+
| to_days('2016-03-23 08:17:01') |
+--------------------------------+
|                         736411 |
+--------------------------------+
Was this article useful?