Из моего понимания
create table #date ( id int, logdate date)
insert #date values
(1,'2018-08-03') -- last month
, (1,'2018-05-03') -- before 4 month
, (1,'2018-03-03') -- before 6 month
, (1,'2018-02-03') -- before 7 month
, (2,'2018-09-03') -- logged on this month
, (2,'2018-05-03') -- before 4 month
, (3,'2018-07-03') -- before 2 month
select *, 'Who logged on before 6 months from last month'
from #date
WHERE DATEPART(m, logdate) <= DATEPART(m, DATEADD(m, -1, getdate())) -- logged date on last month
and DATEPART(m, logdate) >= DATEPART(m, DATEADD(m, -6, getdate())) -- logged date on before 6 months
and id in ( --
select id from #Date where DATEPART(m, logdate) = DATEPART(m, DATEADD(m, -1, getdate())) --
) -- Ids who Logged in past month
/* User 1, who logged on past month. So query gets his past 6 (3,4,5,6,7,8) month's logged date */
Верните меня, если запрос потребует обновления.