﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by sknox  / New Year's Math / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 18 May 2013 11:11:47 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: New Year's Math</title><link>http://www.sqlservercentral.com/Forums/Topic1402165-2794-1.aspx</link><description>Easy One!</description><pubDate>Tue, 15 Jan 2013 12:24:18 GMT</pubDate><dc:creator>asifkareem</dc:creator></item><item><title>RE: New Year's Math</title><link>http://www.sqlservercentral.com/Forums/Topic1402165-2794-1.aspx</link><description>Very interesting question. But a lot of reading :-D</description><pubDate>Fri, 04 Jan 2013 01:31:28 GMT</pubDate><dc:creator>Koen Verbeeck</dc:creator></item><item><title>RE: New Year's Math</title><link>http://www.sqlservercentral.com/Forums/Topic1402165-2794-1.aspx</link><description>Nice question.  I enjoyed it.The "flying duck" code layout made it easy to check that the parentheses matched up, so could see easily that there was no syntax error unless it was caused by those strange literals.  So I had to find out what those strange literals were before going any further.   First I hit on [url=msdn.microsoft.com/en-us/library/windows/desktop/ms710282(v=vs.85).aspx][i]Date, Time, and Timestamp Literals[/i][/url] but the nasty typo on that page ("-type" for "literal-type") confused me so I looked further and found [url=http://msdn.microsoft.com/en-us/library/windows/desktop/ms712360%28v=vs.85%29.aspx][i]Date, Time, and Timestamp Escape Sequences[/i][/url] which gave me what I needed (and showed clearly that my confusion with the earlier page was due to a typo) so now I knew there wasn't a syntax error. So then I could follow a process much like what some others have mentioned. Since a lot of things were added, all integer multiples of one second and none of them zero, the miliseconds in the result had to be the same as in the starting point (non-zero) and the resulting datetime had to be greater than the starting point - so only one of the options fitted the bill.  No need to do any arithmetic - but it made me think!</description><pubDate>Thu, 03 Jan 2013 18:15:53 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: New Year's Math</title><link>http://www.sqlservercentral.com/Forums/Topic1402165-2794-1.aspx</link><description>Interesting question -- I figured out the date math but had to find what that ODBC syntax was about. There is always something new or so far unexplored to learn. Thanks!</description><pubDate>Thu, 03 Jan 2013 09:52:51 GMT</pubDate><dc:creator>Revenant</dc:creator></item><item><title>RE: New Year's Math</title><link>http://www.sqlservercentral.com/Forums/Topic1402165-2794-1.aspx</link><description>I solved it like Toreador, but at the same time I found the explanation about the literals interesting.thanks for the question!</description><pubDate>Thu, 03 Jan 2013 09:09:25 GMT</pubDate><dc:creator>mtassin</dc:creator></item><item><title>RE: New Year's Math</title><link>http://www.sqlservercentral.com/Forums/Topic1402165-2794-1.aspx</link><description>Good topic for a question. However since I always try to get the answer without running the code I tend to really dislike questions with this level of nested logic. I am horrible at being a sql engine but pretty decent at deciphering code. I was unable to keep focus long enough to decipher the overly complicated query. I think you could have presented the idea with a far less complicated query.That being said the explanation was good and it is always good to have a refresher on how these functions work. Thanks for the question.</description><pubDate>Thu, 03 Jan 2013 08:54:00 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>RE: New Year's Math</title><link>http://www.sqlservercentral.com/Forums/Topic1402165-2794-1.aspx</link><description>Thanks for the question.</description><pubDate>Thu, 03 Jan 2013 06:18:01 GMT</pubDate><dc:creator>(Bob Brown)  </dc:creator></item><item><title>RE: New Year's Math</title><link>http://www.sqlservercentral.com/Forums/Topic1402165-2794-1.aspx</link><description>I got this one fine as I have done lots of date time manipulation in SQL and other languages, but I'll happily admit the explanation put an interesting new (for me) perspective on the DATEADD and DATEDIFF functions. Nice one, cheers.</description><pubDate>Thu, 03 Jan 2013 02:52:54 GMT</pubDate><dc:creator>call.copse</dc:creator></item><item><title>RE: New Year's Math</title><link>http://www.sqlservercentral.com/Forums/Topic1402165-2794-1.aspx</link><description>I got it right because although I couldn't be bothered working through the code, it was clearly adding lots of things to @NewYearsEve so the answer was never going to be either @NewYearsEve or @NewYearsDay. As there was no syntax error, that left only one possibility :-)</description><pubDate>Thu, 03 Jan 2013 02:17:22 GMT</pubDate><dc:creator>Toreador</dc:creator></item><item><title>RE: New Year's Math</title><link>http://www.sqlservercentral.com/Forums/Topic1402165-2794-1.aspx</link><description>Nice question and great explanation - didn't know about the literals in the declaration, so thanks for that too.</description><pubDate>Thu, 03 Jan 2013 00:19:10 GMT</pubDate><dc:creator>Michael Riemer</dc:creator></item><item><title>RE: New Year's Math</title><link>http://www.sqlservercentral.com/Forums/Topic1402165-2794-1.aspx</link><description>Nice question Thanks. :-)</description><pubDate>Wed, 02 Jan 2013 23:58:57 GMT</pubDate><dc:creator>louigopal</dc:creator></item><item><title>RE: New Year's Math</title><link>http://www.sqlservercentral.com/Forums/Topic1402165-2794-1.aspx</link><description>Interesting question, thanks</description><pubDate>Wed, 02 Jan 2013 23:56:54 GMT</pubDate><dc:creator>Stewart "Arturius" Campbell</dc:creator></item><item><title>RE: New Year's Math</title><link>http://www.sqlservercentral.com/Forums/Topic1402165-2794-1.aspx</link><description>Yes, Patience is the key..nice question.. too much to read though. :-)</description><pubDate>Wed, 02 Jan 2013 23:05:10 GMT</pubDate><dc:creator>demonfox</dc:creator></item><item><title>RE: New Year's Math</title><link>http://www.sqlservercentral.com/Forums/Topic1402165-2794-1.aspx</link><description>Thanks for the question.</description><pubDate>Wed, 02 Jan 2013 22:36:02 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: New Year's Math</title><link>http://www.sqlservercentral.com/Forums/Topic1402165-2794-1.aspx</link><description>Nice one...nothing complex.. need to read the Qstn with patience...--Dineshbabu</description><pubDate>Wed, 02 Jan 2013 22:09:43 GMT</pubDate><dc:creator>Dineshbabu</dc:creator></item><item><title>New Year's Math</title><link>http://www.sqlservercentral.com/Forums/Topic1402165-2794-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/questions/Datetime+Functions/95937/"&gt;New Year's Math&lt;/A&gt;[/B]</description><pubDate>Wed, 02 Jan 2013 21:40:23 GMT</pubDate><dc:creator>sknox</dc:creator></item></channel></rss>