February 2, 2013 at 2:53 pm
Comments posted to this topic are about the item Date Difference
February 3, 2013 at 9:38 pm
easy one to start the day..
~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one :ermm:
February 3, 2013 at 10:14 pm
Good question. Thanks!
Here is a tip to understand:
1) This is how "0" and "114" will look like when converted to DATETIME
SELECT CAST(0 AS DATETIME) -- 1900-01-01 00:00:00.000
SELECT CAST(114 AS DATETIME) -- 1900-04-25 00:00:00.000
2) Now as per the question
SELECT DATEADD(YY,114,0) --> adding 114 years to "1900-01-01 00:00:00.000" we get "2014-01-01 00:00:00.000"
and
SELECT DATEADD(YY,0,114) --> adding 0 years to "1900-04-25 00:00:00.000" we get "1900-04-25 00:00:00.000"
3) Clearly, both are different. Hence answer is NO 🙂
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
February 3, 2013 at 10:19 pm
nice question....
manik************
Manik
You cannot get to the top by sitting on your bottom.
February 4, 2013 at 12:18 am
Nice question.
Thanks Lokesh for ur additional explaination...
--
Dineshbabu
Desire to learn new things..
February 4, 2013 at 12:37 am
Dineshbabu (2/4/2013)
Thanks Lokesh for ur additional explaination...
Thanks Dinesh 🙂
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
February 4, 2013 at 12:43 am
GOOD basic question 🙂
ALso good explanation by Lokesh 🙂
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 4, 2013 at 2:07 am
Good question, nice easy start to the week.
Tom
February 4, 2013 at 2:20 am
This was removed by the editor as SPAM
February 4, 2013 at 2:56 am
Thanks for the basic one. +1
February 4, 2013 at 3:15 am
Nice 50/50 question that doesn't hurt the brain too much on the morning after Superbowl...:cool:
February 4, 2013 at 5:02 am
kapil_kk (2/4/2013)
GOOD basic question 🙂ALso good explanation by Lokesh 🙂
+1 🙂
_____________________________________________________________________
[font="Comic Sans MS"]"The difficult tasks we do immediately, the impossible takes a little longer"[/font]
February 4, 2013 at 5:20 am
Really need to stop answering these before coffee. 😛
February 4, 2013 at 7:21 am
Easy one in a superbowl hangover..Thanx 🙂
___________________________________________________________________
If I can answer a question then anyone can answer it..trying to reverse the logic.. :hehe:
Viewing 15 posts - 1 through 15 (of 24 total)
You must be logged in to reply to this topic. Login to reply