how can i substitute a NULL value for a 0 in an SQL Query result
- by Name.IsNullOrEmpty
SELECT EmployeeMaster.EmpNo, Sum(LeaveApplications.LeaveDaysTaken) AS LeaveDays
FROM EmployeeMaster FULL OUTER JOIN
LeaveApplications ON EmployeeMaster.id = LeaveApplications.EmployeeRecordID INNER JOIN
LeaveMaster ON EmployeeMaster.id = LeaveMaster.EmpRecordID
GRoup BY EmployeeMaster.EmpNo
order by LeaveDays Desc
with the above query, if an employee has no leave application record in table LeaveApplications, then their Sum(LeaveApplications.LeaveDaysTaken) AS LeaveDays column returns NULL. What i would like to do is place a value of 0 (Zero) instead of NULL. I want to do this because i have a calculated column in the same query whose formular depends on the LeaveDays returned and when LeaveDays is NULL, the formular some how fails. Is there away i can put 0 for NULL such that that i can get my desired result.