Re: Strange date/time anomaly, or am I just stoopid?
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Tue, 30 Aug 2005 21:33:17 +0000 (UTC)
(teddysnips@xxxxxxxxxxx) 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@xxxxxxxxxxxxx
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
.
- References:
- Strange date/time anomaly, or am I just stoopid?
- From: teddysnips
- Strange date/time anomaly, or am I just stoopid?
- Prev by Date: Re: Rewrite a WHERE clause
- Next by Date: Re: How to "undo" a delete with cascades
- Previous by thread: Re: Strange date/time anomaly, or am I just stoopid?
- Next by thread: SQl server processors and threads
- Index(es):
Relevant Pages
|