Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Add Convert for UTC time Expand / Collapse
Author
Message
Posted Wednesday, January 11, 2012 1:59 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Sunday, November 18, 2012 10:58 PM
Points: 63, Visits: 216
worker bee (1/11/2012)
That got it, I had to do some working around on it but I got what I was looking for. Thank you for putting me in the right direction. Next time I will try to more descriptive, sorry about that. I am just a complicated nerd...lol

SELECT COUNT(*) AS [Count], Heading, Value, ServerName, Metric,
CONVERT(VARCHAR(10), UTCOccurrenceDateTime, 111) AS 'CountDate'
FROM dbo.Alerts
WHERE (Heading LIKE 'Disk %')
AND (Heading NOT LIKE 'Disk C%')
AND (Value >= 95.00)
AND (Metric = 64)
AND (UTCOccurrenceDateTime >= DATEADD(day, DATEDIFF(day, 0, GETUTCDATE()), 0))
GROUP BY Heading, Value, ServerName, Metric,
CONVERT(VARCHAR(10), UTCOccurrenceDateTime, 111)
HAVING(COUNT(Heading) < 2500000)
ORDER BY ServerName


I hear ya. Especially when something small really stumps you. Also, check the link I added earlier about date conversions. Seems like a useful site to bookmark. I am always forgetting datetime conversions/casts lol.


-Stephen
Post #1234360
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse