Select DateDiff(Month, CreationDate, LastAccessDate) AS ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Ubuntu

Q&A for Ubuntu users and developers

Select 

DateDiff(Month, CreationDate, LastAccessDate) AS AccessTimeDuration,
Case
When DateDiff(Month, CreationDate, LastAccessDate) < 6 then 'Under 6 months'
When DateDiff(Month, CreationDate, LastAccessDate) between 6 and 12 then '6-12'
When DateDiff(Month, CreationDate, LastAccessDate) between 13 and 18 then '13-18'
When DateDiff(Month, CreationDate, LastAccessDate) between 19 and 24 then '19-24'
When DateDiff(Month, CreationDate, LastAccessDate) between 25 and 36 then '25-36'
When DateDiff(Month, CreationDate, LastAccessDate) > 36 then 'Over 36 months'
END AS Distribution

From Users

Enter Parameters

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