By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,327 Members | 2,661 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,327 IT Pros & Developers. It's quick & easy.

how to calculate number of days between two dates excluding weekends

P: 1
Dear All,

Require your support to write a query in sql server.

I have a table (report) with Country, Status, Open Date, Close date.

Values in country is - India, USA, UK, etc..,

status is - Open, Closed

Open date, close date - is in date and time format

I have to prepare a query with below the conditions.
1) how to calculate no.of days between two dates excluding holidays
2) Holidays are different from country to country (e.g., Sat,Sun or Fri, Sat)
3) If the status is Open, then no.of days difference=current date - open date(excluding holidays)
4)If the status is closed, then no.of days difference=closed date - open date (excluding holidays)

Any help will be highly appreciated.
Oct 7 '13 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.