Workday calculations

  • CalcDate is a table valued function, so I don't think you can use it there.

     

     

     

  • The function is not recognized when I execute the query.

    The only way I have been able the function to work is through statement:

    select date from dbo.calcdate('20070227',-4)  But I can use this in my other query

    Is there an alternative to using a function here?

  • Yep... I missed that... thanks Michael...

    Jeremy, you need to change your function to a scalar function that returns a DATETIME instead of a table... then it should work ok...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 3 posts - 16 through 17 (of 17 total)

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