SELECT TOP 5 CreationDate ,CAST(CreationDate as DateTime)...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Anime and Manga

Q&A for anime and manga fans

SELECT TOP 5 CreationDate
   ,CAST(CreationDate as DateTime)
   ,DATEADD(M, -3, GETDATE())
   ,creationDate+2*365/12 add2Months
   ,datediff(MONTH,creationDate, getDate()) as months_between
   ,CAST(CreationDate as Date)
   ,CAST(CreationDate as Time)
   ,CAST(CreationDate as Char)
   ,CONVERT(VarChar, CreationDate, 104)
   ,CONVERT(VarChar, GetDate(), 104)
   ,MONTH(CreationDate)
   ,Year(CreationDate)
   ,CASE WHEN Year(CreationDate)>=2021 THEN 'Jauns' ELSE 'Vecs' END as Vecums
   ,CASE WHEN (Year(CreationDate)*12+MONTH(CreationDate)+2)>=(Year(GetDate())*12+MONTH(GetDate()))
      THEN 'Jauns'
      ELSE 'Vecs'
   END as Senums
FROM Posts
WHERE CreationDate>=CAST('2021-06-01' AS DATE)
AND CreationDate<=CAST('2021-06-05' AS DATE)

Enter Parameters

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