Hi friends,
please give me an idea on how to design working day details. In my task I want to create table for working days to school. this days except with general holidays and sunday as a holiday. i searched for this in google but i didnt get what i want. please help me and let me know any articles related with this title.
thanks in advance
How can i create working days
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Javeed M ShaikhRank #839 · 2.7K reputationPosted Aug 24, 2012, 12:30 PM EDT
DateTime dt = new Datetime(today);
if (dt.DayOfWeek == DayOfWeek.Thursday Or dt.DayOfWeek == DayOfWeek.Monday ......)
{
// it is working day
}
else
{
// it is a holiday
}
also in SQL Server
Akkiraju IvaturiRank #473 · 5.3K reputationPosted Aug 24, 2012, 6:25 PM EDT
DECLARE @DateOld datetime, @DateNew datetimeSET @DateOld = '10-Sep-2005'SET @DateNew = GETDATE()
SET DATEFIRST 1
SELECT DATEDIFF (day, @DateOld, @DateNew) - (2 * DATEDIFF(week, @DateOld, @DateNew)) - CASE WHEN DATEPART(weekday, @DateOld + @@DATEFIRST) = 1 THEN 1 ELSE 0 END - CASE WHEN DATEPART(weekday, @DateNew + @@DATEFIRST) = 1 THEN 1 ELSE 0 END