4 Replies Latest reply: May 9, 2012 4:37 AM by ShankarViji RSS

    Check constraint help

    790915
      im trying to add a check constraint to a date field so that anyone 17 or under cannot be entered, but im not having much luck. can anyone tell me where im going wrong?
      When i try this:

      ALTER table player
      ADD constraint CHECK(DateOfBirth <= DATEADD(yy, -17, GETDATE()))

      i get:

      ora-00904: "YY" invaild identifier