You are here: Re: Date (not datetime) datatype in 2005? « MsSQL Server « IT news, forums, messages
Re: Date (not datetime) datatype in 2005?

Posted by David Portas on 10/02/34 11:45

Larry Bertolini wrote:
> For some reason, I recall having read that SQL Server 2005 would support
> a datatype that represented date, but not time. (This would be useful
> for storing things like birthday, where you usually don't care about the
> time of day). But I've got SQL Server 2005 installed, and there's no
> such datatype to be found.
>
> Is this something that might be released in a Service Pack, or is it
> just not going to happen?

DATE never made it to RTM. It's not in SP1 either.

Instead try:

CREATE TABLE tbl
(dt SMALLDATETIME NOT NULL CHECK
(DATEADD(DAY,DATEDIFF(DAY,0,dt),0)=dt), ...)

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--

 

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

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