SELECT ServerName, COUNT(ServerName) AS [Count], Value, Heading, REPLACE(CAST(UTCOccurrenceDateTime as date),'-','/') --or try SELECT CONVERT(VARCHAR(10), UTCOccurrenceDateTime, 111) --or try SELECT CONVERT(DATE, UTCOccurrenceDateTime, 111)FROM AlertsWHERE (Heading LIKE 'Disk %') AND (Heading NOT LIKE 'Disk C%') AND (Value >= 95.00) AND DATEADD(hh, -6, UTCOccurrenceDateTime) >= DATEADD(day, DATEDIFF(day, 0, GETUTCDATE()), 0)GROUP BY Heading, Value, ServerName, UTCOccurrenceDateTimeHAVING (COUNT(ServerName) < 2500000)
SELECT CONVERT(VARCHAR(10), UTCOccurrenceDateTime, 111)--orSELECT CONVERT(DATE, UTCOccurrenceDateTime, 111)
SELECTcount(CONVERT(VARCHAR(10), UTCOccurrenceDateTime, 111)) as 'CountDate'FROM AlertsWHERE (Heading LIKE 'Disk %') AND (Heading NOT LIKE 'Disk C%') AND (Value >= 95.00) AND (UTCOccurrenceDateTime >= DATEADD(day, DATEDIFF(day, 0, GETUTCDATE()), 0))GROUP BY Heading, Value, ServerName, UTCOccurrenceDateTimeHAVING (COUNT(Heading) < 2500000)ORDER BY UTCOccurrenceDateTime, ServerName