SELECT DATEADD(dd,(DATEDIFF(dd,0,CRETS)),0), COUNT(*)
FROM Table1
GROUP BY DATEADD(dd,(DATEDIFF(dd,0,CRETS)),0)
SELECT CAST(DATEDIFF(dd,0,CRETS) AS Datetime), COUNT(*)
FROM Table1
GROUP BY CAST(DATEDIFF(dd,0,CRETS) AS Datetime)
--Don't use this:
SELECT CONVERT(Datetime, CONVERT(NCHAR(10), CRETS, 121)), COUNT(*)
FROM Table1
GROUP BY CONVERT(Datetime, CONVERT(nchar(10), CRETS, 121))
Taken from: http://www.sqldisco.com/?p=6
FROM Table1
GROUP BY DATEADD(dd,(DATEDIFF(dd,0,CRETS)),0)
SELECT CAST(DATEDIFF(dd,0,CRETS) AS Datetime), COUNT(*)
FROM Table1
GROUP BY CAST(DATEDIFF(dd,0,CRETS) AS Datetime)
--Don't use this:
SELECT CONVERT(Datetime, CONVERT(NCHAR(10), CRETS, 121)), COUNT(*)
FROM Table1
GROUP BY CONVERT(Datetime, CONVERT(nchar(10), CRETS, 121))
Taken from: http://www.sqldisco.com/?p=6
No comments:
Post a Comment