Hello.
I'm trying to get a date of week to date of week in SQL.
ON vb it can be done like this:
So I'm trying to get a Thursday starting date and a + days plus on end date.Code:Dim dt As DateTime = DateTime.Now.AddHours(-6).[Date] Dim delta As Integer = DayOfWeek.Thursday - dt.DayOfWeek If delta > 0 Then delta -= 6 End If Dim dtFrom As DateTime = dt.AddDays(delta) Dim dtTo As DateTime = dtFrom.AddDays(6)
So on end date I can just add +6 on the starting date. But how can I get the Thursday day of the current week?
Thanks.




Reply With Quote