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 all sundays within date range

Featured Replies

  • Newbies

here's a fun one. given a STARTDate value and ENDDate value, the user sets the QUERYday field by picking a day (Sunday, Saturday, etc) from a drop down menu. She hits the Calculate button and it returns the number of x-days that occur during that range in a calc field, COUNTresult.

So:

STARTdate - 9/1/2002

ENDdate - 10/12/2002

QUERYday - Sunday

would return:

COUNTresult = 6

The practical application is that i have a community center that is open 12-12 on weekdays, 12-8 on saturdays, and is closed on sundays. I need to figure out how many hours the center is actually open during a given date range in order to calculate what our potential capacity is.

i've gotten as far as creating a DAYScalc field that uses the Left(text,size) concatenate trick...


Left(

DayofWeek(QUERYstartdate) &

"

Try this formula:

Int((EndDate-StartDate)/7) +( Mod(EndDate-StartDate, 7) >= Mod(7+QueryDay-DayofWeek(StartDate), 7))

QueryDay is an integer 1..7 representing the day of week where Sunday is 1, Monday is 2, Saturday is 7 etc.

  • Author
  • Newbies

eureka! it works! thanks so much!

mindless me! i used a similar thing for a reservation scheduling system - i just couldn't remember what i'd done or where i'd put the file.

you just indirectly saved our funding for next year! smile.gif

-kc.

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.