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.

Monthly Date Range: 28, 29, 30 or 31?

Featured Replies

30 days hath september...

I'm trying to figure out how to make my date range work. I want to find monthly reports. I've figured out the basic mechanism for getting a date range into a find script (using Insert Calculated Result, not Set Field), but I'm having trouble with the actual calculation.:

(Month(Status(CurrentDate)) - 1)

& "/" &

"1"

& "/" &

Year(Status(CurrentDate))

& "..." &

(Month(Status(CurrentDate)) - 1)

& "/" &

"31"

& "/" &

Year(Status(CurrentDate))

The problem is the month's ending date. Since they vary, I need to account for all possible months.

I also just realized that my script won't work in January. How can I make this work?

The easiest way to avoid having to figure out how many days in a month is to make the end date one day less than the first day of the next month:

Date(Month + 1, 1, Year) - 1

This backs up one day from the first day of the next month. This is just the concept, you will have to work out the actual formulas for your application.

-bd

Or Date(Month + 1, 0, Year).

MD ...

Begin Date:

Date(Month(Status(CurrentDate)) - 1, Day(1), Year(Status(CurrentDate)))

End Date:

Date(Month(Status(CurrentDate)), Day(1) - 1, Year(Status(CurrentDate)))

In the End Date formula, what you're going to get is "the first day of the current month - 1", or, in other words, "the last day of the previous month." Follow that? smile.gif

FileMaker is smart enough to handle the Month and Year bits of the calc when you have values like +1 or -1 or whatever in the Day argument. Filemaker also handles leap year issues within these date calcs.

Good luck!

  • Author

Yes! Sometimes you have to think outside the box, I guess. laugh.gif

Thanks, I learned a small tidbit from all three replies.

Simplified again, make Day(1) 1 and Day(1) - 1 0.

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.