Convert null to zero (not display)

  • Folks,

    I have used both ISNULL() and COALESCE() to convert a null to a zero. Both functions display the column as '0', but if I attempt to use the converted column, say by adding it to another column it returns null. Is there any way of converting my null to a zero for my purposes

    (longtime listenser, first time caller, hence the amateur phrasing of the question!!!)

    Regards

    James

     

     

     

     

     

     

     

     

  • What query did you run??

  • I won't post the full SQL, but I have created two objects. Object 1 returns a value say 100; Object 2 is a null because there is no matching record on the table (outer join). I want to add Object 1 to Object 2 because Object 2 will not always be null and I am summing both columns

    thanks

     

    James

     

  • ISNULL(Object1, 0) + ISNULL(Object2, 0)

    ??

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply