Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1570 > unrolled thread

Re: SSE Weird Day of the Week Result

Started byJeroen Mostert <jmostert@xs4all.nl>
First post2011-02-08 07:52 +0100
Last post2011-02-08 12:36 -0800
Articles 2 — 2 participants

Back to article view | Back to comp.databases.ms-sqlserver

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: SSE Weird Day of the Week Result Jeroen Mostert <jmostert@xs4all.nl> - 2011-02-08 07:52 +0100
    Re: SSE Weird Day of the Week Result Gene Wirchenko <genew@ocis.net> - 2011-02-08 12:36 -0800

#1570 — Re: SSE Weird Day of the Week Result

FromJeroen Mostert <jmostert@xs4all.nl>
Date2011-02-08 07:52 +0100
SubjectRe: SSE Weird Day of the Week Result
Message-ID<4d50e84e$0$41114$e4fe514c@news.xs4all.nl>
On 2011-02-08 01:26, Gene Wirchenko wrote:
>       I am continuing with the textbook I have been studying off and
> on.  I found an interesting error in the date/time functions.

I hope you mean an error in how the textbook uses them, not the functions 
themselves. Standard functions/libraries rarely contain gross errors because 
they would have been found and fixed by now.

> declare @WhatsTheDay date
> set @WhatsTheDay='24 March 2009'
> select
>   datename(dw,datepart(dd,@WhatsTheDay))+', '+

This call resolves to DATENAME(DW, 24). 24, when converted to a DATETIME, is 
1900-01-25 00:00:00.000. January 25th, 1900 was a Thursday (in most 
countries, anyway).

The implicit conversion between INT and DATETIME is a misfeature that can 
easily trip you up, but there's no error in the functions.

-- 
J.

[toc] | [next] | [standalone]


#1594

FromGene Wirchenko <genew@ocis.net>
Date2011-02-08 12:36 -0800
Message-ID<v8a3l6peh9miui79p07vfob3c6eltc6qmp@4ax.com>
In reply to#1570
On Tue, 08 Feb 2011 07:52:59 +0100, Jeroen Mostert
<jmostert@xs4all.nl> wrote:

>On 2011-02-08 01:26, Gene Wirchenko wrote:
>>       I am continuing with the textbook I have been studying off and
>> on.  I found an interesting error in the date/time functions.
>
>I hope you mean an error in how the textbook uses them, not the functions 
>themselves. Standard functions/libraries rarely contain gross errors because 
>they would have been found and fixed by now.

     Ouch.  Yes, I meant the textbook.

[snip]

>The implicit conversion between INT and DATETIME is a misfeature that can 
>easily trip you up, but there's no error in the functions.

     I thought it might be that.  Misfeature is right.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [standalone]


Back to top | Article view | comp.databases.ms-sqlserver


csiph-web