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.

Count specific dates in portal?

Featured Replies

Hello Everyone.

I am trying to get a count on how many entry dates are in september of 2010. i am using the following calculation

If(Month ( attendence::A_DATE )="9" and Year ( attendence::A_DATE )="2010";Count (attendence::A_DATE);"")

And I get the count of all the entry dates. How do I get it to only count the September dates?

Thanks!!

You're making an assumption about how FileMaker processes calculations that isn't correct. I can see how you think it might work; but it doesn't work that way.

For one thing, you are going to have to more explicitly process each item in the list of dates. There are lots of ways to approach the problem.

One way is to create a new field, dateNum, calculation;

Year( A_Date) & right( "00" & month( A_Date); 2) & right("00" & day( A_Date); 2)

Then 9/23/2010 becomes 20100923

Then this would work:

Let( date_list = list( attendance::DateNum);

patternCount( date_list; "201009")

)

patternCount( date_list; "201009")

Careful there: October 9, 2020 is not that far away.

Good point, thanks. An alternative approach would be... ?

Maybe a decimal version? 2010.0923?

Hi krh,

How do you want to use the result? You can perform a find for 9/2010 and then use summary report to count them. You could use a filtered relationship using a global date field in the relationship, or since you have vs. 11, you could use a filtered portal and count them.

You can use a global from anywhere (in example, it is from preferences). Any month/year date you type into global will assume that is the month/year you want filtered. Note the script trigger on the global field.

HowManyDates.zip

Actually, Michael, I like this idea. And I can't see why it wouldn't work. I can't make it break depending upon the example you provided (please see attached). Can you explain what I don't see?

Of course I'm not crazy about the extra field in child AND extra calculation in parent but I'm not crazy about slow speeds on filtered portals (when very large data-sets) either. But at least the result is a calculation which would be more flexible than the filtered portal count.

datenumbers.zip

You are not using the proposed calculation (8 digits instead of 6).

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.