![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Counting Work Days Between Two Dates Topic Summary: Created On: 11-Feb-2005 19:31 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Louie, It came out of this thread. | |
![]() |
|
I need to count the number of work days between two dates where work days are basically Monday through Friday (i.e. no weekends).
Does anyone have a chunk of DXL code that does this? Thanks, Mitch Gerdisch gerdisch@lucent.com |
|
![]() |
|
![]() |
|
The attached function gets the day-of-the-week for a given Date variable. I don't recall how exactly I came up with it, the first second in DOORS time is 1969-Dec-31 6pm as shown in the attached DXL, and the "+ 4+ in the attached function seems to adjust for that fact that that first day was Thursday.
Anyway, this function can be used as a starting point for your DXL. Number of days would be (intOf(today)-intOf(startdate))/cl_SecsInDay. If the start day is Thursday then you have 2 working days that week, then count the number of weeks which is = #Days/7 (dropps remainder), then if the last day was Monday you'd have two more days; for a total of 2 +#weeks*5 + 1 Good luck. - Louie |
|
![]() |
|
![]() |
|
Louie,
It came out of this thread. ------------------------- Michael Sutherland michael@galactic-solutions.com http://galactic-solutions.com Edited: 11-Feb-2005 at 21:30 by Michael Sutherland |
|
![]() |
|
![]() |
|
Yup, doesn't look like the sort of thing I could have come up with myself. I just don't have a good memory for that sort of detail. Have I said that before?
- Louie |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Counting Work Days Between Two Dates
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.