Home All Groups Group Topic Archive Search About

SQL Query to determine time start/end within a time range

Author
2 Mar 2007 3:30 PM
Sammy
From multiple records in a table, for a datetime field I am trying to get the
start/stop time for each range of times that doesn't have a gap of 15 minutes
or more.

Example Output desired from the example records below

Start: 05:57
End:   05:57
Start: 07:09
End:   07:15
Start: 09:06
End:   09:08

Example Data for a DateTime field:

2007-03-02 05:57:38.020
2007-03-02 05:57:40.580
2007-03-02 07:09:42.227
2007-03-02 07:10:18.413
2007-03-02 07:12:54.303
2007-03-02 07:15:29.740
2007-03-02 09:06:45.427
2007-03-02 09:07:46.800
2007-03-02 09:08:01.220


Can this be done by a query?

AddThis Social Bookmark Button