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.

Date functions query

Featured Replies

Is there a date function that returns the last day of a month that results from a calculation, given that this could be 28, 30 or 31?

Alternatively, How can I write an expression that returns the first day of the month following any given date, remembering that December dates will have to return Jan 1 of the following year? I've made a few clunky attempts at this, but none has got off the ground. I use European date format, dd/mm/yyyy.

Cheers.

Use day zero of the next month. Use the date function. Use Month of current dats plus 1, Use year of current date. Make this a date calculation.

Month_Last_Day (calculation field) =

Let ( [ today = Get (CurrentDate ) ; m = month ( today ) ;

y = year ( today ) ] ;

If ( m < 12 ; Date ( m + 1 ; 1 ; y ) - 1 ; Date ( 12 ; 31 ; y ) )

)

(calculation result is date)

Date( Month(Get(CurrentDate)) + 1; 0; Year(Get(CurrentDate)) )

Date( Month(Get(CurrentDate)) + 1; 1; Year(Get(CurrentDate)) )

You don't need to trap whether it's the current year or not. The Date function takes that into account.

Date takes Month, Day, and Year parameters, in that order, regardless of your system's date format. You format a date field in Layout Mode to display the way you want.

Queue:

I think you need to update your profile. Your Skill is Expert and you must be on FMP 7.

I have a copy of 7, yes, but I only use it for answering forum questions. My company still runs everything on 5.5; so that's still my overall version.

I may upgrade my skill to 'Advanced', but I wouldn't go so far as 'Expert'. Thanks for the props though. wink.gif

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.