• I was looking for a quick way to find the 5th business day of each month and this function handles it pretty well, except I have to find it from the end of last month, it seems, rather than the first of this month.

    I used the following and it works pretty consistently so far, but I'm still testing.

    declare @EndOfLastMonth datetime

    select @EndOfLastMonth = dateadd(dd,-day(getdate()),convert(varchar(10),getdate(),120))

    select dbo.fnGetNextBusinessDay (@EndOfLastMonth, 5)

    Thanks Rob! This made a several-hours task into a several-minutes one.