VB.NET - query - Asked By pradeep kumar on 07-Feb-12 07:09 AM

when i Store All government holidays from table ....... so when i given the from date and todate so here it will not counting this days so how to do that please
Venkat K replied to pradeep kumar on 07-Feb-12 07:25 AM
Get the count by checking the dates in the holidays range


DECLARE @startDate DATETIME
DECLARE @endDate DATETIME

--Assign values here
SELECT COUNT(1) FROM tblHolidays WHERE dtHoliday BETWEEN @startDate AND @endDate
--This gives you the count for number of holidays present in the holiday list substract the number from the total number of days in the above range

Thanks
dipa ahuja replied to pradeep kumar on 07-Feb-12 07:42 AM
You have to check the every date with all your holidays and if it matches , then you just have to exclude that day and decrease the count of total holidays