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.
Juggernaut

Date calculation (excluding working days)

Featured Replies

Hello all,

I have a DB which stores some order line for a sale order.

Every record has a code that is the key for a relationship with my supplier database.

All the suppliers has a number that represents the shipment days (i place an order to that supplier and - i.e. - he ship the goods within 3 days).

Here comes the troubles. I must calculate the arrival date excluding all the saturdays and sundays because they aren't working days!

I hope I explained the problem well.

Any idea or suggestion to help me?

  • Author

Well, maybe I've found a simple solution:

Today + ShipmentDays + Celing((ShipmentDays/7)*2);

last number evaluate the number of weeks beetween today and the Shipment date and multiply the week number for 2 (1 = saturday, 2 = sunday).

I use 'ceiling' to avoid decimal numbers.. in fact I'm still testing this calculation, it seems to be a good workaround.. at least It works.

if you have other and better soultions, please share them!

:)-) Bye!

The problem with your formula is that it does not recognize partial weeks. For example, 1 day from Monday should be Tuesday - but you return Wednesday.

See also here.

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.