Unix Technical Forum

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

This is a discussion on SQL Server 2005 - > = 0 is not the same as > 0? within the SQL Server forums, part of the Microsoft SQL Server category; --> I have a statement in my code; Sum(CASE WHEN Rcv > 0 and Rcv < 100 THEN Rcv ELSE ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-01-2008, 03:05 PM
Hermes
 
Posts: n/a
Default SQL Server 2005 - > = 0 is not the same as > 0?

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?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-01-2008, 03:06 PM
David Portas
 
Posts: n/a
Default Re: SQL Server 2005 - > = 0 is not the same as > 0?

On 17 May, 17:25, Hermes <manning...@gmail.com> 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/m...S,SQL.90).aspx
--

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:35 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com