How to get the 1st and last days of the Last week

HI,

How about the following expression?

targetDate = New Date(2022,8,29)

Then

targetDate.AddDays({-7,-1,-2,-3,-4,-5,-6}(CInt(targetDate.DayOfWeek))).ToString("dd.MM.yyyy")

targetDate.AddDays({-13,-7,-8,-9,-10,-11,-12}(CInt(targetDate.DayOfWeek))).ToString("dd.MM.yyyy")

Regards,

1 Like