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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Working Days

Status
Not open for further replies.

gGoodson

Programmer
Jul 11, 2001
5
GB
Can anybody help with calculating the number of working days (e.g. Mon-Fri) between two dates.
 
Short way. (without taking into account of holidays)

Calculate the days difference.
Diff = ToDate - FromDate
Remainder = Diff mod 7
If Remainder = 6 then
Remainder = 5
End If
Working Days = Int(Diff / 7) * 5 + Remainder

 
The best way is to create a Time Dimension. Check Ralph Kimbell's book on Data Warehousing. Gives a good generic time dimension.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top