Home Forums SQL Server 7,2000 T-SQL Using GetDate() in a User Defined Function RE: Using GetDate() in a User Defined Function

  • Here's a quote from BOL: "Built-in nondeterministic functions are not allowed in the body of user-defined functions." Getdate() is, of course, non-deterministic, as it "may return different values when called with the same input parameters" (input parameters being effectively NULL in this case).

    I haven't tried this, but you might be able to get round it by passing getdate() to the function as an input parameter and using that.

    Regards

    Phil

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.