Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.ms-sqlserver    |    Notorious Rube Goldberg contraption    |    19,505 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 18,110 of 19,505    |
|    Jeroen Mostert to Gene Wirchenko    |
|    Re: SSE Weird Day of the Week Result    |
|    08 Feb 11 07:52:59    |
      XPost: microsoft.public.sqlserver.programming       From: jmostert@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.              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca