I am writing a report for which I need to break down the monthly revenue. So Given the Report Parameters (Start and End Date). Given an opportunity's start and end date if any of the dates during that duration fall between the given report parameters, It will show up on the list.
Currently I have the following query, but this does not work for all cases:
SELECT Account.Name, Account.Office__c, Name, Start_Date__c, End_Date__c, Estimated_Production_Revenue_Won__c FROM Opportunity WHERE (Start_Date__c >= 2015-05-01 AND Start_Date__c <= 2015-07-30) OR (End_Date__c >= 2015-05-01 AND End_Date__c <=2015-07-30)
However, I have an opportunity which started on the 1-01-2015 and ends on 12-31-2015 and my report start and end date parameters are 05-05-2015 and 12-31-2015, this does not show up. How would I modify this query so that in this particular case it would show up as well?