November 22, 2007 at 9:57 pm
Comments posted to this topic are about the item
Because time is not infinite ... above all in milliseconds 😀
How to do?
November 26, 2007 at 5:00 am
The explanation is a little lacking. The cause of the overflow error is the use of ms (millisecond)in the command. If another unit of time is used ie second, then no error will result. BOL actually state the maximum length of time. I will leave it to the reader to find this number. (Boy did I hate this statement at uni when I was studying mathematics!)
November 26, 2007 at 5:17 am
declare @timems numeric
select @timems =(cast(datediff (dd,getdate()-28,getdate()) as numeric)* 86400000)
select @timems
--86400000 msxday
November 26, 2007 at 12:54 pm
The following will work even for the ms (milli second) unit of time:
select datediff (ms,getdate()-24,getdate())
Explanation can be found at:
November 27, 2007 at 12:04 pm
Nothing worth "bragging" about. All I had to do was run that query in the Query Analyzer.
And got the answer instantanewously, no delay at all.
So, such trick questions buying "braging" rigths are just too easy.
:doze:
November 27, 2007 at 2:24 pm
Practically all the questions are answered using a query analyzer and/or a google search, but this isn't the way to answer them ... we aren't at school 😛
October 7, 2014 at 7:02 am
Thanks for the question.
October 7, 2014 at 7:03 am
I agree with the other posts. The problem is the ms and this isn't really discussed in the answer.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply