I’m looking to flag those records that are >= 7 days from the previously identify record.
From the example below, the valid records are 4-10-2022, 4-20-2022 and 4-28-2022
drop table #tmp1
create table #tmp1(
membernum int,
sevrfromdate date
)
insert into #tmp1
values (1000016, ‘4/10/2022’)
insert into #tmp1
values (1000016, ‘4/20/2022’)
insert into #tmp1
values (1000016, ‘4/21/2022’)
insert into #tmp1
values (1000016, ‘4/25/2022’)
insert into #tmp1
values (1000016, ‘4/26/2022’)
insert into #tmp1
values (1000016, ‘4/28/2022’)
desired output
New contributor
3