locked
How can I get the Thursday of current week as a date? RRS feed

  • Question

  • Is it possible to get Thursday of the current week as a date, using a select statement?

    For example, no matter what day of the week it is when I run the query, I'll get the Thursday of the current week in date form.

    It should be really simple, but I'm still scratching my head on this. Thanks!

    Thursday, April 16, 2015 3:47 PM

Answers

  • SELECT DATEADD(wk, DATEDIFF(wk,0,GETDATE()), 3) ThursdayOfCurrentWeek

    Hope this helps

    Thanks,

    Nihar

    SELECT DATEADD(wk, DATEDIFF(wk,0,GETDATE()), 3) ThursdayOfCurrentWeek
    


    • Edited by N-SQL Thursday, April 16, 2015 3:58 PM
    • Marked as answer by hatessunlight Thursday, April 16, 2015 4:06 PM
    Thursday, April 16, 2015 3:56 PM

All replies

  • SELECT DATEADD(wk, DATEDIFF(wk,0,GETDATE()), 3) ThursdayOfCurrentWeek

    Hope this helps

    Thanks,

    Nihar

    SELECT DATEADD(wk, DATEDIFF(wk,0,GETDATE()), 3) ThursdayOfCurrentWeek
    


    • Edited by N-SQL Thursday, April 16, 2015 3:58 PM
    • Marked as answer by hatessunlight Thursday, April 16, 2015 4:06 PM
    Thursday, April 16, 2015 3:56 PM
  • Yes, I confirmed that this does this job. Thank you
    Thursday, April 16, 2015 4:06 PM