Return 0 when some information DOESN'T EXIST (not when exists and return null)

๐Ÿ‘:0

You just need an ISNULL. Try this:

SUM(ISNULL(C.con_qtde_fim,0)) AS qtde_produzida

or

ISNULL(SUM(C.con_qtde_fim),0) AS qtde_produzida

Leave a comment