SQL set null values to 0


I have a query that calculates the total number of overtime hours a person worked for daily.  If the person did not work overtime, I get a result of "NULL".  How can I change this value to "0"?

Here is the part of the query that gives me the total hours worked per day:

TotalHours = Cast(substring( convert(varchar(10), dateadd(second,  sum(datediff(second, ClockIn, ClockOut)), 0),
108) , 1,2) + '.' + Cast((Cast(substring(convert (varchar(10), dateadd(second, sum(datediff(second, ClockIn, ClockOut)),
 0), 108) ,4,2) as Int) * 10)/6 as varchar(4)) as decimal(4,2)),
Who is Participating?
Asim NazirCommented:
Try isnull(column, 0)
NerishaBAuthor Commented:
cool, thanks
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.