How I can do to filter in to date range
Select * from XXX where date between DATE1 AND DATE2 OR Between DATE3 AND DATE4
(Copied from update posted as answer)
Here is my condition
WHERE ( items_count != '0' )
AND ( main_table.is_active = '1' )
AND ( main_table.store_id IN ( '0', '1' ) )
AND ( main_table.updated_at BETWEEN
'2011-03-04 16:52:19' AND '2011-03-05 16:52:19'
)
OR ( main_table.updated_at BETWEEN
'2011-03-13 16:52:19' AND '2011-03-14 16:52:19'
)
LIMIT 0, 30
The first condition is never used
Select * from XXX
where (date between DATE1 AND DATE2)
OR
(date between DATE3 AND DATE4)
EDIT:
Try this:
WHERE items_count != '0' AND
main_table.is_active = '1' AND
main_table.store_id IN ('0', '1') AND
( main_table.updated_at BETWEEN '2011-03-04 16:52:19' AND '2011-03-05 16:52:19'
OR
main_table.updated_at BETWEEN '2011-03-13 16:52:19' AND '2011-03-14 16:52:19'
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With