Not knowing in which tables each column comes from 1 is a little difficult to place the exact query that you need, but something in this direction should work:
DELETE FROM t1
FROM mytable t1
INNER JOIN
mytable t2
ON
t1.fkcontractid = t2.fkcontractid and
t1.fkInvoiceId = t2.fkInvoiceId and
t1.ID != t2.ID and
t1.CreatedDate < t2.CreatedDate and
DATEADD(day,30,t1.CreatedDate) >= t2.CreatedDate
, - (ID ) fkcontractid fkInvoiceId, , 30 .
, ( t1) .
1 Invoice , , LEFT JOIN ed, INNER.