Like TG said, all depends on the possible values of UOM, I have a query that ill work in SQL 2005. If you have other possible values for UOM make sure you update the query below:;with mytemp (due, freq, uom, pm_name) as (select cast(due as datetime), freq, uom, pm_name from @sampleunion allselect case when uom = 'week' then dateadd(week,freq, cast(due as datetime)) when uom = 'day' then dateadd(dd, freq, cast(due as datetime))when uom = 'month' then dateadd(mm,freq, cast(due as datetime))end,freq, uom, pm_namefrom mytempwhere cast(due as datetime) < '2008-11-30')select * from mytempwhere due <= '2008-11-30'order by due