I\'m getting this error
msg 8115, level 16, state 2, line 18 Arithmetic overflow error converting expression to data type int.
Is the problem with SUM(billableDuration)? To find out, try commenting out that line and see if it works.
SUM(billableDuration)
It could be that the sum is exceeding the maximum int. If so, try replacing it with SUM(CAST(billableDuration AS BIGINT)).
int
SUM(CAST(billableDuration AS BIGINT))