Skip to content

Instantly share code, notes, and snippets.

@holysugar
Created April 13, 2011 09:37
Show Gist options
  • Save holysugar/917272 to your computer and use it in GitHub Desktop.
Save holysugar/917272 to your computer and use it in GitHub Desktop.
mysql> SELECT CAST('2011-03-31' AS DATE) BETWEEN '2011-02-28 15:00:00' AND '2011-03-30 15:00:00';
+------------------------------------------------------------------------------------+
| CAST('2011-03-31' AS DATE) BETWEEN '2011-02-28 15:00:00' AND '2011-03-30 15:00:00' |
+------------------------------------------------------------------------------------+
| 0 |
+------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT CAST('2011-03-31' AS DATE) BETWEEN '2011-03-01' AND '2011-03-31';
+------------------------------------------------------------------+
| CAST('2011-03-31' AS DATE) BETWEEN '2011-03-01' AND '2011-03-31' |
+------------------------------------------------------------------+
| 1 |
+------------------------------------------------------------------+
1 row in set (0.00 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment