Hi, This code is work only for finding the last friday of the particular month
Declare @Ldate DateTime
Declare @LWN int
Declare @RWN int
Set @RWN=6 -- Sunday=1, Monday=2........
SELECT @LDate=DATEADD(MONTH, 1, 1-DAY(GETDATE())+GETDATE())-1
SELECT @LWN=DatePART(dw,DATEADD(MONTH, 1,...