Jump 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 find "current month" and "next month"?

Featured Replies

Someone earlier on this board kindly helped me with a script to find the current month.

http://www.fmforums.com/forum/showtopic.php?tid/186398/

Now, I would also like to make a script to find both the current month and next month and display the results together. I assume that it can be accomplished by modifying the previous script, but I'm such a rank beginner that I'm not sure what changes to make. Thanks for the help in advance.

Since you're on the latest version should you exploit the newest featurea for searching ranges with *'s

http://www.filemaker.com/help/03-Finding%20sorting6.html

--sd

Yes, but to script such find is often no less complex than calculating the actual start/end dates - especially if you don't want to depend on the file/OS date format.

  • Author

This is the script that I'm using to find the current month. How can I alter it to find the current month plus next month?

Let( monthOffset = Get(ScriptParameter) ;

Date ( Month(Get(CurrentDate)) + monthOffset; 1 ; Year(Get(CurrentDate)) ) & "..." & Date( Month(Get(CurrentDate)) + 1 + monthOffset ; 0 ; Year(Get(CurrentDate))) )

Make another button that calls the same script. In the button definition, enter 1 as the script parameter. To find records of the previous month, make the script parameter = -1, and so on.

  • Author

Thanks for the reply. Yes, I understand about how to set up the Script Parameter to find this month, last month, next month, etc. But, how do I set it up to find records for BOTH this month and next month at the same time?

I appreciate your help.

Current month plus next month?

Let( [monthOffset = Get(ScriptParameter) ;

currentYear = Year(Get(CurrentDate));

currentMonth = Month(Get(CurrentDate)) + monthOffset ];

"{" & currentMonth & "..." & currentMonth+1 "}"

& currentYear )

This will produce something like:

{5...6}/2007

which assumes you're using M/D/Y, and uses the new (FM8 only) date search ranges.

Edited by Guest
Forgot about monthOffset.

Hi Nishimark,

I've always had issues with date formats in FM so I don't really take advantage of the new search types at least not in scripts.. but the method Shawn suggests will work perfectly... Otherwise:

Let( monthOffset = Get(ScriptParameter) ;

Date ( Month(Get(CurrentDate)) + monthOffset; 1 ; Year(Get(CurrentDate)) ) & "..." & Date( Month(Get(CurrentDate)) + 2 + monthOffset ; 0 ; Year(Get(CurrentDate))) )

  • Author

Great! The script from Genex works perfectly. Thanks again for the help.

Create an account or sign in to comment

Important Information

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

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.