Yves Yves - 2 years ago 85
SQL Question

SQL: sum 3 columns when one column has a null value?

+ (TotalHoursT)
+ (TotalHoursW)
+ (TotalHoursTH)
+ (TotalHoursF)
FROM LeaveRequest

Answer Source

If the column has a 0 value, you are fine, my guess is that you have a problem with a Null value, in that case you would need to use IsNull(Column, 0) to ensure it is always 0 at minimum.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download