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
 Transact-SQL (2000)
 Case when problem....i cant see the problem

Author  Topic 

cristianrb
Starting Member

13 Posts

Posted - 2006-04-03 : 06:57:56
dateadd(day,case when isnull(m.media,0) then datediff(day,fc. datafact,fc.scadenta)
when m.media<=0 then datediff(day,fc.datafact,fc.scadenta)
when m.media>90 then datediff(day,fc.datafact,fc.scadenta)else m.media end,fc.datafact)




This is the CASE statement...it seems to be an error somewhere...but i cant see it...do you?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-04-03 : 07:01:49
[code]dateadd(day,case when isnull(m.media,0) = ??? then datediff(day,fc.datafact,fc.scadenta)
when m.media<=0 then datediff(day,fc.datafact,fc.scadenta)
when m.media>90 then datediff(day,fc.datafact,fc.scadenta)else m.media end,fc.datafact)[/code]



KH

Choice is an illusion, created between those with power, and those without.
Go to Top of Page

cristianrb
Starting Member

13 Posts

Posted - 2006-04-03 : 07:06:42
Ok...10x...i should hide under a rock for this mistake...damn it...
Go to Top of Page

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2006-04-03 : 07:10:42
It looks like it's probably down to your first case. There's no test there.

Mark
Go to Top of Page

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2006-04-03 : 07:13:01
oops - a bit behind the times with that reply! Got distracted between typing it and hitting 'post'!

Mark
Go to Top of Page
   

- Advertisement -