Hi please help with this query:declare @t1 table (billingky int, billdt datetime)insert into @t1 values(1,'2010-05-03'),(2,'2010-05-03'),(3,'2010-05-03'),(4,'2010-05-04'),(5,'2010-05-04'),(6,'2010-05-03'),(7,'2010-05-04'),(8,'2010-05-04'),(9,'2010-05-04'),(10,'2010-05-03')to illustrate my point:1,'2010-05-03',1 --1-3 are group 1 for 2010-05-032,'2010-05-03',13,'2010-05-03',14,'2010-05-04',1 --4-5 are group 1 for 2010-05-045,'2010-05-04',16,'2010-05-03',2 --6 is group 2 for 2010-05-037,'2010-05-04',2 --7,8,9 are group 2 for 2010-05-048,'2010-05-04',29,'2010-05-04',210,'2010-05-03',3 --10 is group 3 for 2010-05-03Desired result OutputDate Group Min Max2010-05-03 1 1 32010-05-03 2 6 62010-05-03 3 10 102010-05-04 1 4 52010-05-04 2 7 9
Thanks!