<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: HP Systems Insignt Manager &#8211; Contract and Warranty SQL Query</title>
	<atom:link href="http://www.blogmynog.com/2010/03/18/hp-systems-insignt-manager-contract-and-warranty-sql-query/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blogmynog.com/2010/03/18/hp-systems-insignt-manager-contract-and-warranty-sql-query/</link>
	<description>Microsoft Systems Management</description>
	<lastBuildDate>Wed, 09 Nov 2011 20:34:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Pablo</title>
		<link>http://www.blogmynog.com/2010/03/18/hp-systems-insignt-manager-contract-and-warranty-sql-query/#comment-918</link>
		<dc:creator>Pablo</dc:creator>
		<pubDate>Tue, 05 Apr 2011 20:32:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.blogmynog.com/?p=221#comment-918</guid>
		<description>I was able to get around the error by checking if the length is not greater than 13.  That was the pattern i saw you can try this modification to the function if you like 
 
/****** Object: UserDefinedFunction [dbo].[fn_ConvertDate] Script Date: 06/22/2010 15:21:56 ******/ 
SET ANSI_NULLS ON 
GO 
  
SET QUOTED_IDENTIFIER ON 
GO 
  
ALTER FUNCTION [dbo].[fn_ConvertDate] (@Datetime BIGINT) 
RETURNS DATETIME 
AS 
BEGIN 
 
IF LEN(CAST(@DATETIME as varchar)) &lt;= 13 
BEGIN 
DECLARE @LocalTimeOffset BIGINT 
DECLARE @AdjustedLocalDatetime BIGINT 
DECLARE @ReturnDate DATETIME 
 
SELECT @LocalTimeOffset = DATEDIFF(SECOND,GETDATE(),GETUTCDATE()) 
SELECT @AdjustedLocalDatetime = (@Datetime - @LocalTimeOffset) / 1000 
 
SELECT @ReturnDate = DATEADD(SECOND,@AdjustedLocalDatetime, CAST(&#039;1970-01-01 00:00:00&#039; AS datetime)) 
END 
ELSE 
BEGIN 
SELECT @ReturnDate = CAST(&#039;1970-01-01 00:00:00&#039; AS datetime) 
END 
 
RETURN @ReturnDate 
END </description>
		<content:encoded><![CDATA[<p>I was able to get around the error by checking if the length is not greater than 13.  That was the pattern i saw you can try this modification to the function if you like </p>
<p>/****** Object: UserDefinedFunction [dbo].[fn_ConvertDate] Script Date: 06/22/2010 15:21:56 ******/<br />
SET ANSI_NULLS ON<br />
GO </p>
<p>SET QUOTED_IDENTIFIER ON<br />
GO </p>
<p>ALTER FUNCTION [dbo].[fn_ConvertDate] (@Datetime BIGINT)<br />
RETURNS DATETIME<br />
AS<br />
BEGIN </p>
<p>IF LEN(CAST(@DATETIME as varchar)) &lt;= 13<br />
BEGIN<br />
DECLARE @LocalTimeOffset BIGINT<br />
DECLARE @AdjustedLocalDatetime BIGINT<br />
DECLARE @ReturnDate DATETIME </p>
<p>SELECT @LocalTimeOffset = DATEDIFF(SECOND,GETDATE(),GETUTCDATE())<br />
SELECT @AdjustedLocalDatetime = (@Datetime &#8211; @LocalTimeOffset) / 1000 </p>
<p>SELECT @ReturnDate = DATEADD(SECOND,@AdjustedLocalDatetime, CAST(&#039;1970-01-01 00:00:00&#039; AS datetime))<br />
END<br />
ELSE<br />
BEGIN<br />
SELECT @ReturnDate = CAST(&#039;1970-01-01 00:00:00&#039; AS datetime)<br />
END </p>
<p>RETURN @ReturnDate<br />
END</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.blogmynog.com/2010/03/18/hp-systems-insignt-manager-contract-and-warranty-sql-query/#comment-905</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Wed, 05 Jan 2011 22:04:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.blogmynog.com/?p=221#comment-905</guid>
		<description>thanks for posting!!  I am trying it and I am getting: 
 
Arithmetic overflow error converting expression to data type int. 
 
any ideas of what I maybe doing wrong?  </description>
		<content:encoded><![CDATA[<p>thanks for posting!!  I am trying it and I am getting: </p>
<p>Arithmetic overflow error converting expression to data type int. </p>
<p>any ideas of what I maybe doing wrong?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

