I need to put a rule in a table's column.
Is a date's column. And i need a rule that only accepts an update only if the day is saturday or sunday. And between march to november.
I'm doing this, but doesn't work:
ALTER TABLE MyTable WITH CHECK ADD CONSTRAINT CHECK check_name ( (datepart(dw, myDate) =7 OR (datepart(dw, myDate) = 1)) AND (datepart(mm, myDate) < 2 AND datepart(mm, myDate) < 12 ) )
What's wrong with this? Thank you!