从范围中选择日期而不选择下个月

时间:2017-01-18 09:07:34

标签: mysql date

enter image description here

这是我在数据库中的数据。

:start = 2017-01-13
:end = 2017-02-13

这是我的参数

:start <= DATE(date) AND DATE(date) <= :end

这是我的where子句

我希望获得2017-01-132017-02-13

之间的日期

但是现在我只能从2017-01-132017-01-20

我假设下个月没有。

如何正确获取两个日期之间的日期

更新

enter image description here

这是我使用

时得到的
(date BETWEEN :start AND :end)

我仍然没有得到月份2 2月的日期

echo 2017-01-13-----2017-02-13表示

echo $periodfrom; --> :start
echo "-----";
echo $periodto; --> :end

日期字段数据结构的屏幕截图

enter image description here

0 个答案:

没有答案
相关问题