Get the range of Dates last week Friday to current week Thursday

i want get the range of 7 days dates from last week Friday to this week Thursday. plse help me on this.

Hi @Murali_Boni ,
Use below code
lastFridayDate = Today.AddDays(-7*Cint(Today.DayOfWeek<=DayOfWeek.Friday)+(DayOfWeek.Friday-Today.DayOfWeek))

ThursdayDate = Today.AddDays(Cint(Today.DayOfWeek<=DayOfWeek.Thursday)+(DayOfWeek.Thursday-Today.DayOfWeek))

Regards,
Arivu

Hi @Murali_Boni

dateRange=String.Join(vbCrLf, Enumerable.Range(0, 7).Select(Function(i) DateTime.Now.AddDays(-(DateTime.Now.DayOfWeek - DayOfWeek.Friday + 7) Mod 7 + i).ToString("MM/dd/yyyy")).ToList())

Cheers!!

1 Like

Hi @arivu96
i want list of dates from last week friday to current week Thursday

Thanks @lrtetala. It’s working fine.

@lrtetala
but this code will work, tomorrow is friday right.
Means, today is Thursday right, this week is over in my application. next week should count from tomorrow. Friday To Thursday

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.