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.

Need date calculation script for FP6

Featured Replies

We are running FileMaker Pro 6 on OS9, OSX, Win2k and WinXP systems. FM Server 5.5 is running all the files on OSX.

I need a script written that can take today's date (or an input date, if entered), check the specified number of delivery days, and calculate the actual delivery date. The problem is that the calculation will have to skip Saturdays, Sundays and national holidays (I will input national holidays somewhere else manually, into whatever type of field is appropriate).

I can provide more information as needed, but let me point out I am willing to pay for this. It is not that difficult, but I just do not have time to fiddle in an app I am not that familiar with. I am thinking of something like a $25 retainer and $25 on completion, and if you take PayPal that would be perfect.

If this is something you can handle (no outstanding hurry) please write me here, where everyone can see your name, which should help keep the scam artists away.

If anyone needs more information right now ask here, or offlist.

Thank you.

=====

Edward Lipsett

Fukuoka, Japan

elipsett @ intercomltd.com

See if this helps.

(I don't have version 6, but if you drop both files on the application icon, it should convert fine.)

n_work_days_v.4.zip

  • Author

Yes, I'd say that helps quite a bit.

I haven't actually looked at what you did yet, but it provides the right results and I can get to the actual code, which is enough. With your "Add n Days" script it will be easy enough to adapt it to my existing dbs.

You just earned $50... if you'll tell me where to send it, I'll be happy to pay up!

I wouldn't be comfortable accepting payment for answering a question in these forums. But I know of a good cause that could benefit from your contribution - I will contact you privately about that.

  • Author

I seem to have found a bug... if the input date is, for example, April 28 (a Saturday), and the delivery time is one day, it returns May 2 instead of May 1.

And I may have found why... the ExitLoopIf statement reads:

=====

gCounter ? 0

and

Mod( EndDate - 1 , 7 ) < 5

and

not Holidays::cCount

=====

What is the character after "gCounter"?

Edited by Guest

  • Author

Oops...

Edited by Guest

It's a feature, not a bug. If StartDate itself is not a workday, the count starts from the first upcoming workday. Therefore April 28 + 0 days will return May 1.

The logic being that if 1 workday needs to elapse, the delivery cannot be earlier than May 2. If this is not the desired behavior, you will need to provide an alternative specification.

---

The character there should be 'less or equal'.

  • Author

OK, I see the logic there.

Zero days should mean the same day, but since the initial day is Sat, the 0th day is May 1, and therefore the 1st day is May 2.

Works.

Let me try the <= symbol now...

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.