check if a value is NULL or Less than 0 in one TSQL statement

Posted by Name.IsNullOrEmpty on Stack Overflow See other posts from Stack Overflow or by Name.IsNullOrEmpty
Published on 2010-05-27T10:03:41Z Indexed on 2010/05/27 10:11 UTC
Read the original article Hit count: 115

Filed under:
|
ISNULL(SUM(MyTable.Total), 0) AS Total

how can i modify the above statement to also check if Total is less than 0 (zero), such that if Total is NULL or less than 0 (negative), i assign 0 to Total

© Stack Overflow or respective owner

Related posts about sql-server-2005

Related posts about tsql