Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not able use formula for Work Days - kenhamady

Status
Not open for further replies.

balajee

Programmer
Jun 29, 2000
134
NZ
Hi

I am trying to use the formula "Work Days" given by expert "kenhamady" to find the working days between 2 dates. however I am not getting correct results.

for ex. for StartDate= 20-04-2001 and EndDate=23-04-2001
and working for 5 days a week starting on Monday and ending on Friday, this formula gives me an answer 2 days. Whereas between 20-04-2001 and 23-04-2001 come Saturday and Sunday, so the expected answer should be 1 day.

Could Mr. Kenhamady please correct me where I am going wrong?

Thanks
 
The formula I use always counts both the beginning date and the ending date, if they are both business days. I will go back today and make this clearer on the page that lists the formula, since traditional date math does not do this.

Seagate has a UFL that does this now, and they describe it as "the number of work days in a specified date range", which is a good description.

I have found that most users of the formula want it this way, and I have tested this formula against other versions, finding the same approach. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Thanks for the quick reply.
That clears my doubt.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top