March 18, 2013 at 8:32 am
L' Eomot Inversé (3/16/2013)
Nice question, and fine explanation, but that bit about "59.005" seems to have come from a different than the rest. 😉
I thought that part was weird too, made me think longer about the answer as though it was some kind of trick question, but then I decided to go with the answer that made more sense to me and got it right. =]
Thanks for yet another fine question, Ron!
March 18, 2013 at 9:14 am
sknox (3/18/2013)
I'm curious: What was the point of the cursor-like WHILE and incrementing the ID by 3? Just Obfuscation? Why didn't you just write the query as:
SELECT ID AS 'Select number', DATETIMEFROMPARTS ([Year],M,D,H,Mi,S,Ms) AS 'Datetime'
,CAST(S AS CHAR(2)) + ':' + CAST(Ms AS CHAR(3)) AS 'Original seconds input'
FROM #T
I have the same question as sknox, except I might add an "order by" to his proposed query.
March 18, 2013 at 9:37 am
Nice question, I learnt something new today
March 18, 2013 at 10:27 am
Nice question. I've hit that precision issue before so I guessed correctly. I like that 2012 datefromparts function too.
March 18, 2013 at 11:20 am
Nice one... Thanks, Ron!
March 18, 2013 at 12:23 pm
I missed it, but still a nice one... Thanks, Ron!
Not all gray hairs are Dinosaurs!
March 18, 2013 at 11:11 pm
Nice question and i learned about accuracy and 2012 function(DATETIMEFROMPARTS). I don't know how this accuracy will help me in production..
What I feel is Instead of assigining values to all variables in seperate select statement,Either could have done it in single select or as shokx said straight away could written in one statement..
--
Dineshbabu
Desire to learn new things..
March 19, 2013 at 4:15 am
Thanks for the question.
March 20, 2013 at 1:43 am
Great question, had to read it a few times.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
March 20, 2013 at 7:06 am
I've been catching up with unanswered DATETIME... questions of late so this was an easy one.
March 27, 2013 at 12:37 am
Easy Points
April 4, 2013 at 12:38 am
Good question !!!
April 16, 2013 at 1:16 am
Thanks for this question. Good one. 🙂
April 20, 2013 at 12:08 am
Nice question and nice explanation
Malleswarareddy
I.T.Analyst
MCITP(70-451)
June 15, 2015 at 2:39 am
I didn't know that.
Thanks. Learned again something !
Viewing 15 posts - 16 through 29 (of 29 total)
You must be logged in to reply to this topic. Login to reply