Jump to content
Sign in to follow this  
elipsett

Need date calculation script for FP6

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Oops...

Edited by Guest

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.