working days calculations

Robert J.M. Edis robert.edis@creatcomp.com
Thu, 4 May 2000 12:56:50 -0400


G'day Chris

I think you will have to create a calendar table/file with all non-working
days entered for a given year.  The Quiz program will be able to reference
this table to determine the number of days in a given period to deduct from
the total interval.  As each business has unique non-working days, I can't
see how you can do this without a predefined list.

BTW, the April 2000 issue of Contract Profesional (www.cpuniverse.com) has a
review about working in London, UK.

Regards,

Blue 

-----Original Message-----
From: Chris Sharman
To: powerh-l@lists.swau.edu
Cc: Chris.Sharman@ccagroup.co.uk
Sent: 5/4/00 12:00 PM
Subject: working days calculations

Anyone know of an elegant way of doing working days calculations ?

Ie adding/subtracting a number of working days to a date.

Adding calendar days is easy: DEFINE newdate DATE =
DATE(numdays,olddate)
Taking weekends into account is quite messy:
I get the weekday using MOD(DAYS(olddate),7) and use a conditional
expression.
Eg:
def despdate vmsdate = date(-1.29166667,delivery-date) &
				if (2<mod(days(delivery-date),7)) &
			else date(-3.29166667,delivery-date)

This says for delivery Wed-Sat, we need to despatch by 5pm Mon-Thu;
	and for delivery Sun-Tue, we need to despatch by 5pm Wed-Fri
It probably ought to be more complicated than that.

However, to take account of bank holidays, it gets a whole lot worse,
and the
complexity is dependent on how many days you need to add/subtract.

What I really need is a way to write my own Powerhouse functions, I
think.
Do external would do for Quick, but I really need a solution for Quiz.

Anybody ?

Thanks,
Chris
_______________________________________________________________________
Chris.Sharman@CCAgroup.co.uk		http://www.ccastat.demon.co.uk/
CCA Stationery Ltd, Eastway, Fulwood, Preston, Lancashire, PR2 9WS.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
= =
Subscribe: "subscribe powerh-l" in message body to
majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to
majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.