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)
 calc Days Between

Author  Topic 

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2001-10-22 : 00:59:32

hi

i have small problem with dates.
i have 2 date and i need to find the no on days between them. this can be done by datediff function but my problem starts hear my base month 30 days ie. all months have 30 days (no 31,28...) i have tried out the below qry which works well for few cases

select (datediff(M,'2001/10/08','2001/12/04')*30)+(30-day('2001/10/08'))+1

but if the date are close ie not a 30 days gap then i have a problem

ex st date | end date
'2001/10/10' '2001/11/01'
any help is welcomed

   

- Advertisement -