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)
 days between start date and end date

Author  Topic 

ruchita
Starting Member

5 Posts

Posted - 2007-07-16 : 11:12:28
i need to calcularte days betwwen start date and end date

my syntax is as follows daysbetween(startdate,enddate)

suppose i get 10 days .
from this 10 days i need to exclude sunday "

how do i exclude sundays from my daysbetween(startdate,enddate)

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-16 : 11:24:33
SELECT COUNT(*) FROM F_TABLE_DATE(@StartDate, @EndDate) WHERE DayOfWeek <> 6

F_TABLE_DATE can be found here at SQLTeam.

Or read
http://www.sqlservercentral.com/columnists/plarsson/howmanymoremondaysuntiliretire.asp


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

ruchita
Starting Member

5 Posts

Posted - 2007-07-17 : 01:06:00
thanks for the reply,

am wondering how do i use that syntax in my case .
for eg:

i want to use syntax like daysbetween(startdate,end date)

i have just start date and my current date i stake date difference from start date and current date .
.. plz let me know if my question is clear .
regards,
Ruchita parikh
Go to Top of Page
   

- Advertisement -