SQL Server 2005 - > = 0 is not the same as > 0?

SQL Server 2005 - > = 0 is not the same as > 0?

am 17.05.2007 18:25:49 von manningfan

I have a statement in my code;
Sum(CASE WHEN Rcv > 0 and Rcv < 100 THEN Rcv ELSE 0 END) as D100

It gives me a different number if I just add an "=" sign regarding the
0;
Sum(CASE WHEN Rcv > = 0 and Rcv < 100 THEN Rcv ELSE 0 END) as D100

Does anyone know why this would happen?

Re: SQL Server 2005 - > = 0 is not the same as > 0?

am 17.05.2007 20:37:06 von David Portas

On 17 May, 17:25, Hermes wrote:
> I have a statement in my code;
> Sum(CASE WHEN Rcv > 0 and Rcv < 100 THEN Rcv ELSE 0 END) as D100
>
> It gives me a different number if I just add an "=" sign regarding the
> 0;
> Sum(CASE WHEN Rcv > = 0 and Rcv < 100 THEN Rcv ELSE 0 END) as D100
>
> Does anyone know why this would happen?

Can you post some code to reproduce the problem: a CREATE TABLE
statement and one or two INSERT statements to create some sample data.

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).as px
--