Maybe this will help...if you're using SQL Server.
set datefirst 1
declare @sdate datetime
declare @edate datetime
select @sdate = '20070516' --for example, start date May, 16th
select @edate='20070531' --end date May, 31st
select datediff(day, @sdate, @edate)+1-(
select (case datepart(dw, @sdate)
when 7 then (datepart(ww, @edate)-datepart(ww, @sdate))*2-1
else (datepart(ww, @edate)-datepart(ww, @sdate))*2
end)+
(case datepart(dw, @edate)
when 6 then 1
when 7 then 2
else 0
end)
)
You can also use an auxiliary calendar table...
See :
http://sqlserver2000.databases.aspfa...dar-table.html
Juan T. Llibre, asp.net MVP
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en español :
http://asp.net.do/foros/
======================================
"David C" <dl*****@lifetimeinc.comwrote in message news:eU****************@TK2MSFTNGP06.phx.gbl...
Is there anything in System.DateTime where I can get the number of weekdays (excluding Saturday and Sunday) between 2
dates? Thanks.
David