declare @la int; declare @ga int; declare @lad datetime; declare @gad datetime; select @lad = R.custom6 from View_releases as R select @gad = R.custom7 from View_releases as R set @la = datediff(dd, getdate(), isnull(@lad,getdate())); set @ga = datediff(dd, getdate(), isnull(@gad,getdate())); select '', final.DateCalcType, sum(final.f) from (select 'LA in days' as DateCalcType, @la as f union select 'GA in days' as DateCalcType, @ga as f ) final group by final.DateCalcType