• Hi Again!

    Open your report and go to Report > Report Properties > Code

    Then paste in the below:

    Function LastWorkingDay(StartDate As DateTime) As DateTime

    Dim StartDateDOW = DatePart(DateInterval.Weekday, StartDate)

    Dim DaysBack = 0

    If (StartDateDOW) = 7 Then

    DaysBack = -3

    Elseif StartDateDOW = 1 Then

    DaysBack = -4

    Else

    DaysBack = -2

    End If

    LastWorkingDay = DateAdd(DateInterval.Day,DaysBack,StartDate)

    End Function

    The above will get the working day 3 back from the day passed to the function. So we can use this function to get the last working day of last month by putting the below code into an expression in your report item:

    =Code.LastWorkingDay(DateSerial(Year(Today()),Month(Today()),0))

    You can pass in the last day of this month to the same function and it will give you the correct working day. Make sure you test it for November 2014 to make sure you're happy with the results.

    SQL SERVER Central Forum Etiquette[/url]