Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Michael Sutherland, on Friday, March 11, 2005 4:57 PM

Answer:
Louie,

It came out of this thread.
 11-Feb-2005 19:31
User is offline View Users Profile Print this message


Mitchell Gerdisch

Posts: 1
Joined: 11-Feb-2005

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
Report this to a Moderator Report this to a Moderator
 11-Feb-2005 20:31
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 11-Feb-2005 21:27
User is offline View Users Profile Print this message


Michael Sutherland

Posts: 248
Joined: 13-Sep-2002

Answer Answer
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
Report this to a Moderator Report this to a Moderator
 15-Feb-2005 18:23
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.