examine this line:WHERE CAST(a.LocID AS nvarchar) = CAST(b.LocID AS nvarchar))
working example:set nocount ondeclare @Import_Usage_Dates_Day table (LocID text, LocUsageNoHrs int, LocUsageNoHours int)insert into @Import_Usage_Dates_Dayselect 'a',1,null union allselect 'a',3,null union allselect 'a',4,null union allselect 'a',7,null union allselect 'b',3,null union allselect 'b',3,null union allselect 'b',3,nullselect * from @Import_Usage_Dates_DayUPDATE aSET LocUsageNoHours = (SELECT SUM(b.LocUsageNoHrs) FROM @Import_Usage_Dates_Day b WHERE CAST(a.LocID AS nvarchar) = CAST(b.LocID AS nvarchar))FROM @Import_Usage_Dates_Day aselect * from @Import_Usage_Dates_Day