You are here: Re: How to find the maximum possible value of a given datatype « MsSQL Server « IT news, forums, messages
Re: How to find the maximum possible value of a given datatype

Posted by Roy Harvey on 06/27/07 01:56

How about just hardcoding what is in the documentation? DATETIME, for
example says "Date and time data from January 1, 1753 through December
31, 9999, to an accuracy of one three-hundredth of a second
(equivalent to 3.33 milliseconds or 0.00333 seconds)." Which after
consulting the accompanying chart comes to 9999-12-31 23:59:59.997.

Roy Harvey
Beacon Falls, CT

On Wed, 27 Jun 2007 01:39:49 -0000, "jshunter@waikato.ac.nz"
<jshunter@waikato.ac.nz> wrote:

>Does anyone know of a built-in function to return the maximum possible
>value of a given datatype? I have to return the biggest value for a
>smalldatetime or datetime in a view if the field is null, but can't
>find such a function. The closest I've come is:
>
>select datalength(cast(getdate() as smalldatetime))
>
>...but that only return the number of bytes, not the value itself,
>which is '6-6-2079 11:59'
>
>I know I could create my own lookup table and function, but I was
>hoping that Transact-SQL would have a built-in solution
>
>--John Hunter

 

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

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