Russell writes "I am using stored procedures to check my distribution servers for replication errors. I have the code shown below(code listing one) in a stored procedure on each of the distribution servers. The results of the stored procedure are stored in a table on the main distribution server.I then have a separate stored procedure that just does a select all from the populated table. Select * from ReplicationReportOrder by Time descThe structure of which is shown below. This works as it is, however replication errors remain in the resulting table until all the entries that you see by looking at task history have status of successful. What I would like to do is to only pull out the entries for the last 10 mins, replication on the network runs every 10 mins.COLUMN_NAME TYPE_NAME LENGTHRunDate varchar 10Time varchar 12ServerName varchar 15Subsystem varchar 15DistributionServer varchar 15ErrorDescription varchar 50Code Listing 1-----------------Truncate table replication reportselect distinct RunDate = + ' ' + substring(convert(varchar(10), h.rundate), 7,8) + '/' + substring(convert(varchar(10), h.rundate), 5,2) + '/' + substring(convert(varchar(10), h.rundate), 3,2), Time = case when runtime < 100000 then + '0' + substring(convert(varchar(10), h.runtime), 1,1) + ':' + substring(convert(varchar(10), h.runtime), 2,2) + ':' + substring(convert(varchar(10), h.runtime), 4,2)else + ' ' + substring(convert(varchar(15), h.runtime), 1,2) + ':' + substring(convert(varchar(15), h.runtime), 3,2) + ':' + substring(convert(varchar(15), h.runtime), 5,2)End,"Server Name" = substring(t.name, charindex('_g',t.name)+1, 10),'Subsystem'=rtrim(t.subsystem),'Error Description'=rtrim(h.comments)from syshistory h, systasks twhere h.taskid = t.id and h.runstatus != 1 andconvert(varchar,h.rundate) = convert(varchar,getdate(),112)and t.subsystem='Distribution'order by Time desc"