CREATE TABLE #testtable(date datetime, Job VARCHAR(20))
-- Inserting Data into Table
INSERT INTO #testtable(date,job)
DECLARE @Weekday CHAR(9) = 'Friday'
MAX(DATE) AS last_day
datepart(dw,date) = d.dw
AND d.DoW = @Weekday
) ld ON ld.last_day = t.date
This will do what you want and can be used with any day of the week. Let me know if you've got any questions.
On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
—Charles Babbage, Passages from the Life of a Philosopher
How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537