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.

Business days between any two dates

Featured Replies

I just tried the following, posted elsewhere in the forums:

Case[DayofWeek[OrderDate] < 5 , OrderDate + 9 , DayofWeek[OrderDate] = 5 or DayofWeek[OrderDate] = 6 , OrderDate + 11 , DayofWeek[OrderDate] = 7, OrderDate + 10,""]

But this only works if there are only 7 days between. I actually need 12 business days starting from my order date.

Are you trying to FIND the number of business days between two dates?

Or are you trying to set a date that is X business days after a different date?

The first can be done with a calculation field, the second needs a script.

The solution I wrote takes account of business HOURS as well (eg if someone raises a support request after 5.30pm, the clock doesn't start ticking until after 9am).

Yours

James

See if this helps:

http://fmforums.com/forum/showtopic.php?tid/162774/

  • Author

Heh. In the meantime I did this, with the result as timestamp:

Choose( DayOfWeek(GetRepetition ( Date ; 1 ) );

GetRepetition ( Date ; 1 )+ 60*60*24*16;

GetRepetition ( Date ; 1 )+ 60*60*24*16;

GetRepetition ( Date ; 1 )+ 60*60*24*16;

GetRepetition ( Date ; 1 )+ 60*60*24*21;

GetRepetition ( Date ; 1 )+ 60*60*24*21;

GetRepetition ( Date ; 1 )+ 60*60*24*20;

GetRepetition ( Date ; 1 )+ 60*60*24*14)

But this seems to be working strangely. It looks like choose is 0-based... is that so?

Edited by Guest

  • Author

Looks like it is, and I had my numbers wrong.

The following (I think) gives 12 business days from a given timestamp as timestamp:

Choose( DayOfWeek(theTimestamp) );

"";

theTimestamp+ 60*60*24*16;

theTimestamp+ 60*60*24*16;

theTimestamp+ 60*60*24*16;

theTimestamp+ 60*60*24*18;

theTimestamp+ 60*60*24*18;

theTimestamp+ 60*60*24*17;

theTimestamp+ 60*60*24*16)

Can someone check if this is correct?

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.