How to get date range between two columns?
SELECT
ccm.`date_from`
, ccm.`date_to`
, ccd.`rate`
FROM
`currency_conversion_master` ccm
, `currency_conversion_details` ccd
WHERE ccm.conv_m_id=ccd.conv_m_id AND DATE(date_from)>=DATE('2012-10-12') AND DATE(date_to) <= DATE('2012-10-14')
in this way query does not filter the record when i put 2012-10-13.
I mean as
DATE(date_from)>=DATE('2012-10-13') AND DATE(date_to) <= DATE('2012-10-14')
How do i do this?
This is the database structure with data
date_from date_to
2012-10-12 2012-10-14
2012-10-15 2012-10-19
2012-10-20 2012-10-30
use