How many days was I active?

1

Please login or register to vote for this query.

(click on this box to dismiss)

Returns amount of days when you've posted at least one answer.

Stack Overflow

Q&A for programmers

-- How many days was I active?
-- Returns amount of days when you've posted at least one answer.

SELECT COUNT(DISTINCT CONVERT(char(10), CreationDate, 111)) AS days
FROM Posts
WHERE OwnerUserId = ##UserId##
-- GROUP BY CONVERT(char(10), CreationDate, 111)

-- Without DISTINCT this returns amount of posts per day in spite of GROUP BY.

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached