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()))
ora-00904: "YY" invaild identifier