Advertisement
Guest User

Untitled

a guest
Oct 4th, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.53 KB | None | 0 0
  1. SELECT [Name] AS [Game],
  2.   CASE WHEN DATEPART(HOUR, [Start]) >= 0 AND
  3.             DATEPART(HOUR, [Start]) < 12 THEN 'Morning'
  4.        WHEN DATEPART(HOUR, [Start]) >= 12 AND
  5.             DATEPART(HOUR, [Start]) < 18 THEN 'Afternoon'
  6.        ELSE 'Evening'
  7.   END AS [Part of the Day],
  8.   CASE WHEN Duration <= 3 THEN 'Extra Short'
  9.        WHEN Duration >= 4
  10.          OR Duration <= 6 THEN 'Short'
  11.        WHEN Duration > 6  THEN 'Long'
  12.        WHEN Duration IS NULL THEN 'Extra Long'
  13.   END AS [Duration]
  14. FROM [Games]
  15. ORDER BY [Name], Duration, [Start]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement