A contract is active between 1/1/2013 (fromdate) and 6/30/13 (todate). There are thousands of these contracts in our database, each with different to and from dates. I am trying to figure out the "where" that will pull any contracts that had March as an active month (it could be 1 day or 2 weeks of that month - doesn't matter).
SELECT *
FROM Table
WHERE fromdate >= 2013-03-01 AND todate <= 2013-03-31
The above only seems to get me contracts that start in March (and I also have table joins, more where stuff, etc - if that needs to be included, let me know). Can anyone help me correct this so I get any and all contracts that include March somewhere
within the dates? It seems so simple but yet I feel so lost on this. Again, not looking for a specific date, looking for a month where a contract was "active" if you will.
Thoughts?