Com Two weeks

0

Please login or register to vote for this query.

(click on this box to dismiss)

Tridion

Q&A for Tridion developers and administrators

SELECT myUser.Id, count(myComment.Id) AS [Comment_before]
  FROM (SELECT DISTINCT Users.Id
    FROM Users
    inner join Posts p on p.owneruserid = Users.Id
    inner join Votes v on p.Id = v.postid
    WHERE (p.PostTypeId =2 AND v.votetypeid =2 AND ((AboutMe LIKE '%buymeacoffee%') OR (AboutMe LIKE '%ko-fi%')) 
    AND reputation > 10)) AS myUser
  left join (SELECT c.Id as cid, c.CreationDate, u.Id
   FROM Comments c
   INNER JOIN Posts p on c.PostId = p.Id
   INNER JOIN users u ON P.OwnerUserId = u.Id
   WHERE p.OwnerUserId = c.UserId
    AND (c.CreationDate BETWEEN DATEADD(week,-2,'##Date1?2021-10-01##') AND '##Date1?2021-10-01##')
    AND p.PostTypeId =2
  ) AS myComment
  on myUser.Id = myComment.Id
  GROUP BY myUser.Id
  ORDER BY myUser.Id

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results