Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Datediff function

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-07-30 : 13:55:42
Chad writes "declare @StartDate varchar(50)
declare @EndDate varchar(50)
declare @DayCount int

select @StartDate = '04/01/01'
select @EndDate = '06/29/01'


select @DayCount = datediff(dw,@StartDate,@EndDate)

The query above gives me a count of all the days between two dates. What I want is just the weekdays M-F and not the all the days. Is there a different fucntion I can use for this?

Any help would be greatly apprciated
regards
Chad

SQL 7.0 and 2000
Windows 4.0 NT server and Windows 2000 server"
   

- Advertisement -