Hi I need the data between previous month second friday till current date using SQL.
Hi I need the data between previous month second friday till current date using SQL.
This appears to generate the second Friday of the previous month. Over to you to leverage that in your query.
SELECT DATEADD( DAY, 13 - DATEPART(WEEKDAY, DATEADD(DAY, 0, DATEADD(MONTH, DATEDIFF(MONTH, '20010101', @getdate) - 1, '20010101'))), DATEADD(MONTH, DATEDIFF(MONTH, '20010101', @getdate) - 1, '20010101') ) AS SecondFridayOfLastMonth
19 People are following this question.