Thanks
Then you can subtract the count of dates in the table that fall between
sdate and edate:
select count(*) from offdates where offdate between sdate and edate
If you don't include sat and sun dates in the table, then you have to loop
from sdate to edate, use dateadd 1 day and get the day name and check...
The sophisticated way of doing this, and for any scheduling app, would be to
use a Time Dimension table (used in data warehousing) which would include
dates for at least 3 years with many other fields - with this you can get
what you want in a single SQL statement. If you are interested in this,
check out Ralph Kimball books.
--
Mike S.
Optimal Systems www.oscorp.com
--
"Scott" <scott.s...@53.com> wrote in message
news:00aa01c347ce$d3455fc0$a401...@phx.gbl...
http://www.datastrat.com/Code/GetBusinessDay.txt
--
HTH
Van T. Dinh
MVP (Access)
"Scott" <scott.s...@53.com> wrote in message
news:00aa01c347ce$d3455fc0$a401...@phx.gbl...