Here is one way:--------------------------------------------Set up a test tableset nocount onif object_id('tempdb..#t') > 0 drop table #tcreate table #t (id int, dt datetime)go--------------------------------------------populate with sample data for 2000 rows for about 100 customers over about 3 month period at random timesinsert #t (id, dt)select convert(int, ceiling(rand()*100)) ,dateadd(hour, rand()*24*30*3, dateadd(month,-3,getdate()))go 2000--select * from #t order by 1,2--------------------------------------------SELECT statementselect t.id ,avg(datediff(hour, t.dt, ca.dt)) [AvghoursBetweenCustCalls] ,min(datediff(hour, t.dt, ca.dt)) [MinHoursBetweenCustCalls] ,max(datediff(hour, t.dt, ca.dt))[MaxHoursBetweenCustCalls] ,count(*) [CustCallCount]from #t tcross apply ( select top 1 dt from #t where id = t.id and dt > t.dt order by dt ) cagroup by t.idorder by t.idoutput:id AvghoursBetweenCustCalls MinHoursBetweenCustCalls MaxHoursBetweenCustCalls CustCallCount----------- ------------------------ ------------------------ ------------------------ -------------1 85 4 282 222 148 11 412 143 81 1 262 244 114 13 327 185 102 3 526 206 117 0 456 167 111 9 375 178 106 0 346 199 92 1 348 1910 107 1 342 1911 128 6 512 1612 155 14 399 1313 92 1 377 2214 227 30 645 815 117 0 318 1616 149 18 396 1317 84 0 382 2518 96 0 238 2219 114 1 334 1520 110 8 371 1921 87 1 286 2222 87 10 409 2423 128 12 306 1224 79 5 203 2625 89 8 192 1826 101 6 415 2027 110 14 348 1828 95 17 275 2229 71 1 278 2930 131 8 436 1531 131 3 395 1632 80 3 270 2533 114 1 528 1834 79 0 292 2535 106 8 337 2036 153 1 621 1337 91 4 436 2138 80 3 236 2539 93 8 260 1940 155 3 680 1341 109 47 286 1942 106 17 223 2043 99 8 421 2044 107 9 375 1245 148 8 379 1446 85 3 374 1947 116 7 252 1748 96 4 492 2149 118 2 309 1750 104 12 306 1651 129 13 275 1352 142 4 388 1553 110 5 429 1754 107 22 296 1955 100 5 259 2156 91 3 462 2357 75 3 237 2558 65 2 207 3159 162 2 420 1360 99 9 314 1961 141 13 363 1462 76 3 304 2763 91 6 272 2264 120 12 360 1765 71 4 307 2966 88 2 335 2267 88 4 363 2268 250 5 423 769 114 7 246 1870 82 2 425 2571 126 9 521 1672 123 7 394 1673 100 2 340 1974 89 2 308 2175 93 3 391 2176 103 13 290 1977 80 2 200 2578 145 17 484 1479 92 1 373 2180 79 3 327 2581 86 0 287 2182 153 2 651 983 86 1 365 2384 102 6 334 2085 105 0 303 2086 177 1 371 1187 181 30 668 1188 93 0 548 2289 106 2 333 1890 114 5 275 1891 97 6 526 2292 128 6 414 1593 95 8 266 2094 91 3 305 2095 67 1 267 2896 97 16 410 2197 83 1 413 2598 96 3 375 1999 102 19 205 13100 121 5 279 15Be One with the OptimizerTG