Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How do I calculate the date of last month's first Monday ?

Featured Replies

  • Newbies

Hi.

How do I calculate the date of last month's first Monday ?

Eg. If today is in the month of July 2006, the result will be June 5, 2006.

Thanks in advance.

Pumin

I modified a formula from the KnowledgeBase on the filemaker.com web site to do what you want:

Let(

[Today = Get(CurrentDate);

FirstDay = Date(Month(Today) - 1; 1; Year(Today))];

GetAsDate(7 * Int((FirstDay + 7) / 7) +

Case(DayOfWeek(FirstDay) < 3; -6; 1))

)

You can place a date field reference in the first parameter of the Let function instead of the Get(CurrentDate) function.

...or, if you want to easily remember:

Let(

first = Date ( Month ( Get ( CurrentDate ) ) - 1 ; 1 ; Year ( Get ( CurrentDate ) ) );

Case(

DayOfWeek ( first ) = 1;first + 1;

DayOfWeek ( first ) = 2;first;

DayOfWeek ( first ) = 3;first + 6;

DayOfWeek ( first ) = 4;first + 5;

DayOfWeek ( first ) = 5;first + 4;

DayOfWeek ( first ) = 6;first + 3;

DayOfWeek ( first ) = 7;first + 2;

)

)

  • Author
  • Newbies

Thanks a lot for fast replies. I learnt a new function today.

Let ( lastMonth = date ( Month ( date ) - 1 ; 1 ; Year ( date ) ) ; lastMonth + Mod ( 2 - DayOfWeek ( lastMonth ) ; 7 ) )

:wink2:

Edited by Guest
Corrected calc

Hm... that looks slightly familiar. :joust:

I learn from the best! :laugh2:

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.