Was the user active in the last 12 months

0

Please login or register to vote for this query.

(click on this box to dismiss)

If we define active as writing a question or an answer. Was the given user active for the last 12 months?

Audio-Video Production Meta

Q&A about the site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation

-- uid: User Id
DECLARE @user INT = ##uid:INT##

IF ( (SELECT TOP 1 DATEDIFF(MONTH,GETDATE(),p.CreationDate) AS 'Date'
      FROM Posts p WHERE p.OwnerUserId = @user ORDER BY 'Date' DESC) < -12)
    SELECT 'No';
ELSE
    SELECT 'Yes';

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results