 <p>Based on the description of what you are doing, I don't understand why you think your query works.</p> <p>The overlap query should look like this:</p> <pre><code>SELECT AssetID as UnAvailableAsset FROM agreementasset WHERE CheckOutDate &lt;= @RentEndDate AND ExpectedReturnDate &gt;= @RentStartDate; </code></pre> <p>This type of query can be difficult to optimize (in most databases). You can start with an index on <code>agreementasset(CheckOutDate, ExpectedReturnDate, AssetID)</code>.</p>