By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,863 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

Help entering in a constraint, Please!

P: n/a
Please, any help is GREATLY appreciated. I need to have SQL Server 2000
Check a field (EffectiveDate) to make sure the date is any date in the
future past today. I've gotten as far as the 'Manage Constraints' Part
in SQL Server 2000 and entered in ([EffectiveDate] <= getdate())

But I really don't know what the syntax is or what you have to do to
get this going.. I can't find anything on the web about it either :\

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 10 Jun 2005 06:27:55 -0700, "Beacher" <be*****@gmail.com> wrote:

SQL Server books online has an explanation, under "constraints".
Your syntax is almost correct. However remember that future dates have
a date greater than today :-) Try this:
EffectiveDate > getdate()
For it to work, you must have no existing data violating that rule, or
you must take off the 'check exising data on creation' check.

-Tom.
Please, any help is GREATLY appreciated. I need to have SQL Server 2000
Check a field (EffectiveDate) to make sure the date is any date in the
future past today. I've gotten as far as the 'Manage Constraints' Part
in SQL Server 2000 and entered in ([EffectiveDate] <= getdate())

But I really don't know what the syntax is or what you have to do to
get this going.. I can't find anything on the web about it either :\


Nov 13 '05 #2

P: n/a
omg my whole problem was my less-than sign.. I feel dumb lol, thank you
SO much.. last question.. is there a way I can have a custom message
other then the ugly error message SQL Server gives you?

Nov 13 '05 #3

P: n/a
On 10 Jun 2005 07:39:00 -0700, "Beacher" <be*****@gmail.com> wrote:

Depends on how you're updating/inserting your record. If in a bound
form, use the Form_Error event. If through the Execute method, use a
runtime error handler.

-Tom.

omg my whole problem was my less-than sign.. I feel dumb lol, thank you
SO much.. last question.. is there a way I can have a custom message
other then the ugly error message SQL Server gives you?


Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.