Mazdak writes "I have two date column(date1,date2) and one varchar column(datediff1) and one column for identity(Sou_ID). I write this trigger so when one row inserted into table it gets two dates and compute the difference and put it in varchar column. At this point its ok but when I close the table and open it again to insert new row only my last row has DATEDIFF and others got NULL. :(ALTER Trigger tr1 on Source for insert as update source set datediff1=(select CONVERT(varchar(50),DATEDIFF(month,(select date1 from Source where Sou_ID=(select max(Sou_ID) from Source)),(select date2 from Source where Sou_ID=(select max(Sou_ID) from Source))))where Sou_ID=(select max(Sou_ID) from Source))
"