title: How to calculate distance between multiple points in SQL Server?
body: <p>I have table with data from GPS, e.g.: <code>Latitude</code>, <code>Longitude</code>, <code>Time</code>, <code>UserId</code></p>
  
  <p>How to aggregate total distance in specified time frame summing all distances by all points (ordered by time) and group data by user?</p>
  
  <p>Thanks</p>