I have the table of following structure:
UserID StartedOn EndedOn 1 2009-7-12T14:01 2009-7-12T15:01 2 2009-7-12T14:30 2009-7-12T1
you do a selfjoin on that table