SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Add Convert for UTC time


Add Convert for UTC time

Author
Message
stephen99999
stephen99999
SSC-Enthusiastic
SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)SSC-Enthusiastic (105 reputation)

Group: General Forum Members
Points: 105 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 :-D

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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search