worker bee (1/11/2012)
This converted the date but now I need to count...SELECT
CONVERT(VARCHAR(10), UTCOccurrenceDateTime, 111)
FROM Alerts
WHERE (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, UTCOccurrenceDateTime
HAVING (COUNT(Heading) < 2500000)
ORDER BY UTCOccurrenceDateTime, ServerName
easy enough. Are you receiving errors or something? if so it would be wonderful of you to post them. Also, in the future, you should really try to be more descriptive in your problem, question, and desired result.
SELECT
count(CONVERT(VARCHAR(10), UTCOccurrenceDateTime, 111)) as 'CountDate'
FROM Alerts
WHERE (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, UTCOccurrenceDateTime
HAVING (COUNT(Heading) < 2500000)
ORDER BY UTCOccurrenceDateTime, ServerName