If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Date Timeframe, remove Saturday and Sunday.

Started by handpass, 29 Jan 2007 09:14:34 AM

Previous topic - Next topic

handpass

Hi,
          I am using Report Studio to develop reports for a manufacturing plant. In one of my reports I have a start-date and a finish-date, which I subtract from one another in order to get the number of days it took for a process to run.

The start and finish date can be weeks apart and I would like to just count working days, Monday - Friday. Is there anyway that I can remove the days Saturday and Sunday from the calculation?

Regards.

MFGF

Hi,

I had an old example of this from back in the days of Impromptu.  I have quickly modified it to make it suitable for Report Studio, but I'd advise you to test it well to ensure I've got it right.

Three query calculations are required, as follows:

Working Days from 1900 to Start Date:
  (floor(_days_between([Start Date],1899-12-31)/7) * 5) + (mod(cast(_days_between([Start Date],1899-12-31), integer),7))

Working Days from 1900 to End Date:
  (floor(_days_between([End Date],1899-12-31)/7) * 5) + (mod(cast(_days_between([End Date],1899-12-31), integer),7))

Working Days from Start Date to End Date Inclusive:
  if ( mod (cast(_days_between([End Date],1899-12-31),integer) , 7 )  = 6) then ([Working Days from 1900 to End Date] - [Working Days from 1900 to Start Date])
  else ( [Working Days from 1900 to End Date] - [Working Days from 1900 to Start Date] + 1 )


Hope this gives you what you need!

Best regards,

MF.
Meep!