下面是我在搜索中使用的查询
我在搜索中有日期范围,当我在“01/05/2012”和“31/05/2012”日期范围之间搜索数据但查询返回所有记录集时。
SELECT t.created date, t.saleid sale_id, u.id user_id, NULL merchant_name, cheque_number cheque_number, u.first_name name, (
SELECT company_name
FROM users
WHERE id = u.my_charity_id)charity_name, t.campaignname website, t.campaignid campaign_id, t.mysoko_discount discount_percentage, t.discount, t.salecommission sale_commission, t.salevalue total_sale_value, t.salestatus sale_status
FROM `transaction` AS `t` , `users` AS `u`
WHERE DATE_FORMAT( t.created, '%d/%m/%Y' )
BETWEEN '01/05/2012' AND '31/05/2012'
AND t.user_id = u.id
LIMIT 0 , 30
我正在寻找日期范围搜索数据,但结果返回表中的所有数据。
date sale_id user_id
2012-04-19 00:00:00 20253305 45
2012-04-11 00:00:00 20253306 68
2012-04-23 00:00:00 20253307 68
2012-04-25 00:00:00 20253308 45
2012-04-27 00:00:00 20253309 45
2012-04-29 00:00:00 20253310 68
2012-04-30 00:00:00 20253311 45
2012-05-01 00:00:00 20253312 45
2012-05-03 00:00:00 20253313 68
2012-04-18 00:00:00 20253314 4
我的搜索来自日期范围 txn 搜索(从/到日期)
输入日期格式:DD/MM/YYYY