Number of HNQs entered/removed per days - between two days

1

Please login or register to vote for this query.

(click on this box to dismiss)

Drupal Answers Meta

Q&A about the site for Drupal developers and administrators

SELECT 
  CAST(ph.CreationDate AS DATE) AS [Date],
  SUM(case when ph.PostHistoryTypeId=52 then 1 else 0 end) AS [HNQs],
  SUM(case when ph.PostHistoryTypeId=53 then 1 else 0 end) AS [Removals]
FROM PostHistory ph 
WHERE (ph.PostHistoryTypeId in (52,53)) 
  AND (ph.CreationDate >= '##Date1?2022-01-01##') AND (ph.CreationDate <= '##Date2?2023-01-01##')
GROUP BY CAST(ph.CreationDate AS DATE)
ORDER BY CAST(ph.CreationDate AS DATE)

Enter Parameters

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