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

How to calculate Business Days in Report Studio?

Status
Not open for further replies.

shanmku

Programmer
Jan 16, 2007
17
US
Is there an inbuilt function available for calculating Business Days between two given dates?

Any advice will be more helpful. Thanks in Advance.

Kumar
 
Hi,

Strange - this is the second time this question has come up recently. I don't see it for years, then twice in a few days! :)

Try the following:

Three query calculations are required:

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 )

Best regards,

MF.
 
Ditto - seen this very recently

See the responses to 'Report Studio: Remove Sat and Sun from date timeframe'. There were a number of different approaches
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top