Changes

Jump to: navigation, search

Working with Dates and Times in MySQL

587 bytes added, 15:58, 23 October 2007
Retrieving Data Based on Date and Time Criteria
+----------+------------+---------------------+----------------+
1 row in set (0.00 sec)
</pre>
 
Similarly we can use the ''BETWEEN'' clause to lists deliveries that fall between two specific dates. For example:
 
<pre>
mysql> SELECT * FROM orders WHERE order_delivery BETWEEN '2007-12-01' AND '2008-01-01';
+----------+----------------+---------------------+----------------+
| order_no | order_item | order_date | order_delivery |
+----------+----------------+---------------------+----------------+
| 2 | ipod Touch 4Gb | 2007-10-23 11:51:09 | 2007-12-23 |
+----------+----------------+---------------------+----------------+
1 row in set (0.03 sec)
</pre>

Navigation menu