Reply to Re: Strange date/time anomaly, or am I just stoopid?

Your name:

Reply:


Posted by Erland Sommarskog on 10/01/97 11:25

(teddysnips@hotmail.com) writes:
> 1900-01-01 18:00:00 1900-01-02 00:00:00 1.2
>
> So, it's storing the time 23:59:59 as midnight. That's odd.

Not particularly. As noted by Damien, smalldatetime does fit any seconds.

> If I put the cursor in a new row, and type into the TimeFrom column
> 18:30:00 and the TimeTo column 19:30:00 and the RateMultiplier column
> 1.3, and refresh the data by pressing the red shriek !, I get this:
>
> 01/01/1900 18:00:00 01/01/1900 23:59:59 1.2
> 18:30:00 19:30:00 1.3
>
> If I re-run the SELECT from the QA, I get this:
>
> 1900-01-01 18:00:00.000 1900-01-01 23:59:59.000 1.2
> 1899-12-30 18:30:00.000 1899-12-30 19:30:00.000 1.3
>
> Is it just me, or does this seem to be remarkably inconsistent?

In SQL Server time zero is 1900-01-01 00:00:00.000

In other Microsoft environments - COM, Visual Basic etc - time zero is
1899-12-30 00:00:00.000. Apparently the junior programmer that was tasked
to do the Open Table function was not aware of this difference.

Well, no one forces you to use EM.
--
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

[Back to original 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

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