title: Random Datetime In given Datetime Range
body: <p>I need to get a random date-time within a range of 2 date-times in T-SQL for MS-SQL server 2012. It is necessary for me that it goes to the precision of seconds, I need DATETIME2(0) as datatype for both input and output. I have done some research online but the answers I could find are either for dates only or are for other database types. </p>
  
  <p>The code should do something like:</p>
  
  <p>Input:  ('2015-01-01 08:22:13' , '2015-03-05 17:56:31') &lt;-- I will use a select statement to replace these absolute numbers</p>
  
  <p>Return: ('2015-02-11 14:32:45') &lt;--this should be randomized </p>
  
  <p>Can anyone help me out with this?</p>
  
  <p>Thanks in advance</p>