try like this & seeCreate Table #AspectHandled(LogDate DateTime,Offered Int,)Insert Into #AspectHandled (LogDate, Offered)Select LogDate, Count (Disposition)FROM [tblRawCMDudExTWCMCAspect]Where (Disposition = '2' or Disposition = '4' or Disposition = '5' or Disposition = '7' or Disposition = '9' )And (Offered = '2' or Offered = '15')And LogDate>=DATEADD(month,DATEDIFF(month,0,GETDATE())-1,0)Group By LogDateUpdate tSet t.Offered = #TA.OfferedFrom #AspectHandled As #TAJOIN tblCMDashAppAspect tON t.linkingcol=#TA.linkingcol
linkingcol are columns by which temp table and your table are related