title: SQL Server : not inserting date when date is already present in table
body: <p>Basically I do not want user to insert the date which he already get inserted in past in table.</p>
  
  <p>My query is working in below cases but in one case it get fails, and in query I return an integer value if it is greater then 0 then I do not allow user to enter the dates.</p>
  
  <p>In database already inserted dates are :</p>
  
  <ul>
  <li>Start date : 1 April 2016 and     End date :   30 April 2016</li>
  <li>Start date : 1 May 2016 and   End date :   31 May 2016</li>
  </ul>
  
  <p>Below cases</p>
  
  <pre><code>            Start Date              End Date
  Case 1)      1 march 2016           23 march 2016    working
  Case 2)      1 june 2016            15 june 2016     working
  Case 3)     15 april 2016           15 may  2016     NOT working
  </code></pre>
  
  <p>Date time format is: <code>yyyy-mm-dd hh:mm:ss</code></p>
  
  <p>This is my query</p>
  
  <pre><code>SELECT 
      COUNT(1) AS [A1]
  FROM 
      [dbo].[CandidateExperience]
  WHERE 
      ([CandidateID] = 50) 
      AND ([CandidateExperienceID] &lt;&gt; 118) 
      AND ([DeletedBy] IS NULL) 
      AND (NOT ((('2015-04-15 00:00:00' &lt;[StartDate]) OR ('2015-04-15 00:00:00' &gt; [EndDate]))
          OR (('2015-04-30 00:00:00' &gt; [EndDate]) OR ('2015-04-30 00:00:00'&lt; [StartDate]))))
  </code></pre>