We help IT Professionals succeed at work.
Get Started

How can I exclude weekends and holidays in datediff ASP.NET function?

Last Modified: 2013-12-26
Hey Guys,

In my web app, a webuser submits a form and the date/time submitted is recorded in the db. The form is then put on a queue for processing.

Now, when an employee logins into the app and processes the forms on the queue, the time from when the form was submitted minus the time it was processed is recorded via the datediff function.

The problem that I face, is that the date difference is including weekends(non-business) and holidays, thus, producing invalid data when running reports.

For example, if a form is submitted on friday and not processed until monday, the date diff would record more than 48 hours.

How can I detect weekends and holidays using ASP.NET VB?

Watch Question
C# ASP.NET Developer
Top Expert 2010
This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE