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


Please login or register to vote for this query.

(click on this box to dismiss)

Open Source Meta

Q&A about the site for people organizing, marketing or licensing open source development projects

SELECT TOP 5 CreationDate
   ,CAST(CreationDate as DateTime)
   ,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)
   ,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

Switch to main site
loading Hold tight while we fetch your results