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!

SSRS working days formula/function with bank holidays

Status
Not open for further replies.

javedi

Technical User
Apr 30, 2007
196
GB
Hello,

I'm struggling to find or write a SQL or .net function or SSRS expression to calculate working days between a CreatedDate and ClosedDate, the function must include bank holiday dates.

I'm working from a database where creating SQL functions are not permitted, however I can embed the SQL in the dataset and can create a lookup table for the bank holiday dates.

I'm hoping someone has one to share or can help me create one?

Any help appreciated.

Thanks,
Javedi

 
I can't get the exact expression syntax out, but you might try something that follows this sort of logic:

((Difference in days between Date1 and Date2) + 1) - ((Difference in weeks between Date1 and Date2) * 2) - (1 if Date1 is Sunday) - (1 if Date2 is Saturday)

I think that will get you the weekday count at least.
 
Thanks jjefferson, it's a start but surprised there's no easy way of doing what should be a common function, nor is there much information on the web.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top