August 13, 2012 at 9:15 am
bitbucket-25253 (8/11/2012)
L' Eomot InversΓ© (8/11/2012)
Nice easy question to start the week with (2 days early).I wonder if the 100% correct rate will continue when everyone sees it and starts answering on Monday. π
Going to hades in a hand basket already
Correct answers:75%
(6)
Incorrect answers:
25%
(2)
Total attempts: 8
563 attempts so far and things got better. Looking at 88% correct now.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
August 13, 2012 at 9:19 am
But nothing was added...Not complaining though
August 13, 2012 at 3:24 pm
Great one and thanks for the easy one.
August 13, 2012 at 3:51 pm
BudaCli (8/13/2012)
But nothing was added...Not complaining though
Yes there was, 0 (zero) seconds was added to the 0 (zero date, 1900-01-01 00:00:00.000).
August 13, 2012 at 7:58 pm
Amazing command that dateadd having datepart second, month, etc. Need to know what you are doing when you use it...
From the explanation, it says that:
If datepart is month and the date month has more days than the return month and the date day does not exist in the return month, the last day of the return month is returned. For example, September has 30 days; therefore, the two following statements return 2006-09-30 00:00:00.000:
SELECT DATEADD(month, 1, '2006-08-30')
SELECT DATEADD(month, 1, '2006-08-31')
Learn something more today!
Thanks
August 14, 2012 at 6:24 am
Little behind... Took me until Tuesday...... to get it.... RIGHT. Monday was rough for sure. π
August 14, 2012 at 9:19 pm
tilew-948340 (8/13/2012)
Amazing command that dateadd having datepart second, month, etc. Need to know what you are doing when you use it...From the explanation, it says that:
If datepart is month and the date month has more days than the return month and the date day does not exist in the return month, the last day of the return month is returned. For example, September has 30 days; therefore, the two following statements return 2006-09-30 00:00:00.000:
SELECT DATEADD(month, 1, '2006-08-30')
SELECT DATEADD(month, 1, '2006-08-31')
Learn something more today!
Thanks
very rightly pointed out...DATEADD does not check if the date is a valid date or not π
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
August 15, 2012 at 1:06 pm
Lokesh Vij (8/14/2012)
tilew-948340 (8/13/2012)
Amazing command that dateadd having datepart second, month, etc. Need to know what you are doing when you use it...From the explanation, it says that:
If datepart is month and the date month has more days than the return month and the date day does not exist in the return month, the last day of the return month is returned. For example, September has 30 days; therefore, the two following statements return 2006-09-30 00:00:00.000:
SELECT DATEADD(month, 1, '2006-08-30')
SELECT DATEADD(month, 1, '2006-08-31')
Learn something more today!
Thanks
very rightly pointed out...DATEADD does not check if the date is a valid date or not π
Thanks for the question!
August 21, 2012 at 2:35 pm
Been out for a while and just got to this. Nice question. Appreciate getting the brain back in gear with an easy one.
Not all gray hairs are Dinosaurs!
May 30, 2013 at 2:49 am
Viewing 10 posts - 16 through 24 (of 24 total)
You must be logged in to reply to this topic. Login to reply