hi,this is a small case:create table test(customerID int,signature char(5),invoiceID int,entryDate smalldatetime,expiryDate smalldatetime,valid char(1))insert into testselect 123, 'SIG_A', 3255, '20091001', null, null union allselect 123, 'SIG_B', 4264, '20091009', null, null union allselect 123, 'SIG_A', 4351, '20091009', null, null union allselect 123, 'SIG_A', 4353, '20091011', null, null union allselect 231, 'SIG_A', 2425, '20081224', null, null union allselect 231, 'SIG_A', 4012, '20090823', null, null
what would be the optimal update for field "expiryDate" and field "valid (values (Y|N))" in case when customer "CustomerID" have two signatures 'SIG_A'. Field expiryDate must be updated with previous last EntryDate, all previous fields Valid must be update with value N, current valid signature 'SIG_A' must have valid null and expirydate also null.p.s.: i'm using sql 2000.thank you for ideas.