Q&A for professional and enthusiast programmers
-- year: use a negative number for how many years back you want to query declare @yr as int = ##year:int## select p.id as [Post Link] from posts p where body like '%```%' and creationdate between dateadd(yy, @yr-1, getdate()) and dateadd(yy, @yr , getdate()) and not exists ( select 1 from posttags pt inner join tags t on t.id = pt.tagid where pt.postid = coalesce(p.parentid, p.id) and t.tagname in ('r', 'rmarkdown'))