Determine the Last Friday of each Month?

Hello all,

I need to determine the last friday of each month.

In the situation of today being the last friday of each month to invoke a sequence. Thank you

What is the best way to go about this?

Hi @alexis.garcia ,

Do you need the Date of the Last Friday as the Output?


Have a view on this thread for ideas

Cheers @alexis.garcia

1 Like

Yes exactly

I think it will be works:
lastFriday.7z (35.6 KB)

How do i open this>?

Thanks taking a look

1 Like

it is 7zip.
Below you will find zip file and in Windows you can do right click and choose extract" (2.5 KB)

1 Like

Thanks i just tweaked that file you sent me

Thanks this works well !

Enumerable.Range(-6,7).Reverse().Select(Function (x) now.AddDays(- now.Day + 1).AddMonths(1).AddDays(-1 + x).Date).Where(Function (x) x.DayOfWeek = 5 ).First

or in Query Syntax:

(From i In Enumerable.Range(-6,7).Reverse()
Let d = myDateTime.AddDays(- now.Day + 1).AddMonths(1).AddDays(-1 + i).Date
Where d.DayOfWeek = 5
Select fr=d).First()

1 Like

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