SQL RULE with date function

  • I am trying to create a rule that will validate that a date field is before now (today, current date, whatever).  Does anyone know how I can do this?

    Thanks

  • CREATE RULE rl_BeforeNow AS @dtDate < GETDATE()

  • Sorry to butt in, David.

    Remember to bind the rule to the column that you want the rule on as well using 'sp_bindrule'. The rule does not apply to all date fields.


    ------------------------------
    The Users are always right - when I'm not wrong!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply