Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To: Prevent record update if
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00877709
Message ID:
00877716
Views:
13
This message has been marked as the solution to the initial question of the thread.
>Somehow, I've got a "bug" in my vfp application that the user can occanically manage to "move" a scheduled event to the year 1899, what I'm guessing is was some type of invalid invalid date value during the udpate. It has only happened 3 times in the last 12 months, so it's fairly rare, but I'm hoping I can prevent the record at the database level from being updated if the year portion of the date being updated is two years prior to the current system date. I don't know enough about writting triggers to know if I can do this in like a instead of type of trigger.
>
>Thanks for any pointers.
>
Kirk,

You can use Check Constraint
datepart(year,[mydate]) >= datepart(year,getdate()) - 2)
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform