This discussion is archived
4 Replies Latest reply: May 9, 2012 4:37 AM by ShankarViji RSS

Check constraint help

790915 Newbie
Currently Being Moderated
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

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points