SQL Server 2000 SP3
I have the following T-SQL that does not return anything. Which is correct because no records match the criteria (a possible case that must be handled). However I need to be able to return a zero (0) in this case so that the return value can be used in a math function as part of a larger stored procedure. I am at a loss. Any suggestions?
zemp
I have the following T-SQL that does not return anything. Which is correct because no records match the criteria (a possible case that must be handled). However I need to be able to return a zero (0) in this case so that the return value can be used in a math function as part of a larger stored procedure. I am at a loss. Any suggestions?
Code:
SELECT SUM(CDHours) as hours
FROM TCDetail
WHERE (CDDate <= '07/29/2005')
GROUP BY ECode
HAVING (ECode = 'STA')
zemp