• Created the function using copy / paste / execute - no reported error then tested using the following:

    DECLARE @Bdays AS INT

    SET @Bdays = dbo.fn_GetBusinessDays('07/06/2008','07/27/2008')

    SELECT @Bdays

    Result returned 14 ..

    Now counting on my fingers it is actually 15 days

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]