|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, June 08, 2011 4:12 PM
Points: 146,
Visits: 120
|
|
Comments posted to this topic are about the item
Because time is not infinite ... above all in milliseconds :D
How to do?
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Monday, October 20, 2008 4:01 PM
Points: 147,
Visits: 53
|
|
| 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!)
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, June 08, 2011 4:12 PM
Points: 146,
Visits: 120
|
|
declare @timems numeric select @timems =(cast(datediff (dd,getdate()-28,getdate()) as numeric)* 86400000) select @timems --86400000 msxday
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, April 10, 2013 3:04 PM
Points: 839,
Visits: 938
|
|
The following will work even for the ms (milli second) unit of time:
select datediff (ms,getdate()-24,getdate())
Explanation can be found at: http://technet.microsoft.com/en-us/library/ms189794.aspx
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Monday, September 14, 2009 5:22 AM
Points: 438,
Visits: 918
|
|
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.

|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, June 08, 2011 4:12 PM
Points: 146,
Visits: 120
|
|
| 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 :P
|
|
|
|