okay, i think i understand (maybe) try this query -- SELECT a,b,c , case when DATEDIFF(day, b ,getdate()) >= 3 then 0 else 1 end as which_group order by which group asc , DATEDIFF(day, b ,getdate()) rudy http://r937.com/