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!

Excluding Saturdays and Sundays between two dates 1

Status
Not open for further replies.

Anu1284

Programmer
Sep 24, 2003
25
US
For the BO report that I need to create, I have two different dates. I need to find the difference between the two dates excluding saturdays and sundays.

For example,

Date 1: 03-Nov-03
Date 2: 10-Nov-03

The result should be

Total Days: 5 (excluding saturdays and sundays).

Please let me know how this can be brought into the report.
 
One way ( and the way how I deal with this) is to use a calenderfile specially designed for working days calculations. It is simply a list of dates with a countercolumn. The special thing is that all weekends (and in my case fixed holidays) are excluded from the list.

Use this as an additional dataprovider and link over the dimension date. Use the counter to do the calculations.

Such a file can be easily created using Excel and can be imported into the DWH or used a file dataprovider....

T. Blom
Information analyst
tbl@shimano-eu.com
 
I got that stuff working. If anyone is interested, please find the solution below:

Create three variables in the report.

Number of Weekends: =Truncate((DayNumberOfWeek(<Start Date>)+DaysBetween(<Start Date> ,<End Date>)) /7 ,0)

Non Working Days: = <Number of Weekends>*2

Number of days : =Floor((DaysBetween(<Start Date> ,<End Date>)-<Non Working Days>))

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top