title: mysql Check if date is greater than 0000-00-00
body: <p>I would like my orderedDate column <em>(using the date type)</em> to not allow null or 0000-00-00</p>
  
  <p>I've set the orderedDate column as not null, but when using insert into</p>
  
  <pre><code>INSERT INTO Purchase(custName, price)
  VALUES('Max Wong', 10.00)
  </code></pre>
  
  <p>Ordered date is 0000-00-00. I assume this is because it is the default value when no other value is given. </p>
  
  <p>I've also tried</p>
  
  <pre><code>ALTER TABLE Purchase
  ADD CHECK (orderedDate &gt; '0000-00-00');
  </code></pre>
  
  <p><em>(also orderedDate > 0000-00-00 and orderedDate > 0)</em></p>
  
  <p>And I read to try</p>
  
  <pre><code>SET mysql_mode = 'NO_ZERO_DATE' 
  </code></pre>
  
  <p>But it didn't work.</p>
  
  <p>I've seen a lot of php suggestions when looking online but I have to use sql.</p>