//查询最近6个月
SELECT * FROM Receipt WHERE ReceiptData between date_sub(now(),interval 6 month) and now() ORDER BY ReceiptData DESC;
//查询上一个月
SELECT * FROM Memo WHERE date_format(CreaterTime,'%Y-%m')=date_format(DATE_SUB(curdate(), INTERVAL 1 MONTH),'%Y-%m') ORDER BY CreaterTime DESC;
//查询本月
SELECT * FROM Memo WHERE date_format(CreaterTime,'%Y-%m')=date_format(now(),'%Y-%m') ORDER BY CreaterTime DESC;
//查询当天
SELECT * FROM Memo WHERE date(CreaterTime) = curdate() ORDER BY CreaterTime DESC;
//查询每周
SELECT * FROM Memo GROUP BY WEEK(CreaterTime)
//查询最近4周
SELECT CreaterTime FROM Memo WHERE YEARWEEK(date_format(CreaterTime,'%Y-%m-%d'))> YEARWEEK(DATE_SUB(NOW(),INTERVAL 4 WEEK)) GROUP BY YEARWEEK(CreaterTime);
//查询当天
SELECT * From Memo Where to_days(CreaterTime) = to_days(NOW())
//查询某天及以后的数据
SELECT * From Memo Where CreaterTime>=curdate()