Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Date Ranges - How to get results that include a certain month?

$
0
0

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?


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>