title: Using date in a check constraint, Oracle
body: <p>I am trying to check add the following constraint but Oracle returns the error shown below.</p>
  
  <pre><code>ALTER TABLE Table1
  ADD (CONSTRAINT GT_Table1_CloseDate
  CHECK (CloseDate &gt; SYSDATE),
  CONSTRAINT LT_Table1_CloseDate
  CHECK (CloseDate &lt;= SYSDATE + 365)),
  CONSTRAINT GT_Table1_StartDate
  CHECK (StartDate &gt; (CloseDate + (SYSDATE + 730))));
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Error report:
  SQL Error: ORA-02436: date or system variable wrongly specified in CHECK constraint
  02436. 00000 -  "date or system variable wrongly specified in CHECK constraint"
  *Cause:    An attempt was made to use a date constant or system variable,
             such as USER, in a check constraint that was not completely
             specified in a CREATE TABLE or ALTER TABLE statement.  For
             example, a date was specified without the century.
  *Action:   Completely specify the date constant or system variable.
             Setting the event 10149 allows constraints like "a1 &gt; '10-MAY-96'",
             which a bug permitted to be created before version 8.
  </code></pre>