这是我的日期数据;从 : 09-01-2013 到 : 22-01-2013 (格式固定)
如何将列日期格式化为send_date_time
..d-m-Y
以下是我的查询:
$filter = "and DATE_FORMAT(send_date_time,'%d-%m-%Y') BETWEEN '08-01-2012 12:00:00' and '22-01-2013 12:00:00' ";
但是当我尝试使用这个(下面)查询时,上面的查询失败了,是的可以工作:
$filter = "and send_date_time BETWEEN '2013-01-08 12:00:00' and '2013-01-22 12:00:00' ";
完整查询
$get_transaction_history = ("select * from `sms_sendlog` where store_id='".$store."' ".$filter." order by id desc");
柱子:
Colum Name : send_date_time
e.g value : 2012-10-22 10:19:36