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

Author  Topic 

Rita Bhatnagar
Posting Yak Master

172 Posts

Posted - 2001-04-17 : 16:53:46
If i don't use case it works perfect but
it does not without it
select
.
.
.
Where ....
And a.PeriodStarting =case when @period<> 0 then (
between (select dateadd(day,-day(@period)+1,@period))
and (select dateadd(day,-day(@period2),@period2))
Else a.PeriodStarting End


   

- Advertisement -