Working days
Marley, Peter
peter.marley@acco-uk.co.uk
Thu, 15 Feb 2001 13:46:50 -0000
Hamid,
Try this code
;
; convert the due date and the delivered date into days
;
DEFINE D_DAYS_DUE NUM*9 = DAYS(D_DT_REQD)
DEFINE D_DAYS_DEL NUM*9 = DAYS(DT_CONF)
;
; calculate the relative week number of the days due (the due week) and
; the relative week number of the days delivered (the delivered
week)
;
DEFINE D_DUE_WK_NO INT*4 = (D_DAYS_DUE/7) + 1
DEFINE D_DEL_WK_NO INT*4 = (D_DAYS_DEL/7) + 1
;
; calculate how many weekends between the 2 dates and the number of
; weekends into days
;
DEFINE D_WEEKENDS INT*4 = ABS((D_DEL_WK_NO - D_DUE_WK_NO) * 2)
;
; calculate the difference (+/-) between the due date (required date) and
; the delivered date (delivery confirmed date) ignoring weekends
;
DEFINE D_DAYS NUM*9 = D_DAYS_DUE - D_DAYS_DEL - (D_WEEKENDS *
D_SIG`
Peter
__________________________________
Peter Marley
Data Warehouse Developer, Acco Europe
Tel: +44 (0)1296 732184
Fax: +44 (0)1296 732185
email: peter.marley@acco-uk.co.uk <mailto:peter.marley@acco-uk.co.uk>
-----Original Message-----
From: Bourchi, H. [SMTP:bourchih@unive.nl]
Sent: Thursday, February 15, 2001 1:34 PM
To: 'powerh-l@sphere.swau.edu'
Subject: Working days
Hello everybody,
I am trying to find a easy way (in QTP) to calculate how
many working days are between two dates. For example between 23/01/2001 and
23/02/2001 are 24 working days. Working days are all days of the week except
Zaterday and Sunday.
Ik think I have to force something like a LOOP on QTP but I
don't know how.
We are running on PH 7.10.F2 and OpenVMS for ALPHA V7.1-1H1.
Thanks in advance!
Hamid
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
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.