You are here: Re: Error : Difference of two datetime columns caused overflow at runtime. « MsSQL Server « IT news, forums, messages
Re: Error : Difference of two datetime columns caused overflow at runtime.

Posted by Erland Sommarskog on 10/20/77 11:27

geekwagon@gmail.com (geekwagon@gmail.com) writes:
> At my job is a dts package that is failing in SQL 2005. I am not a SQL
> expert. I am just trying to fix. I put the query in Query Analyzer
> and get this error:
>
>
> (4322 row(s) affected)
>
> Server: Msg 535, Level 16, State 1, Line 1
> Difference of two datetime columns caused overflow at runtime.
>
>
> I am just trying to understand what this means, what I should be
> looking for and what could be wrong. Here is the query:
>
>
> SELECT i.SerialNumber, '' AS mac_number, DATEDIFF([second], 'Jan 1,
> 1970', s.DateOrdered) AS Support_StartDt, DATEDIFF([second], 'Jan 1,
> 1970',
> s.Warranty_Enddate) AS Support_EndDt,
> DATEDIFF([second], 'Jan 1, 1970', c.Registration_Date) AS

One or of the rows has a value that is in 2038 or later in one of the
columns. My bets are on Warranty_Enddate and somehas put in 99991231
for an infinite warranty.

(2038-01-19 03:14:07.000 is the time when the number of seconds since
1970-01-01 exceeds the range of an un integer.)

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация