something like this ?declare @sample table( [user] int, [datecol] datetime)insert into @sampleselect 1, '2009-08-01' union allselect 2, '2009-08-06' union allselect 3, '2009-08-12' union allselect 1, '2009-08-31' union allselect 2, '2009-08-20'select [user], [1], [2], [3], [4], [5], [6]from( select [user], week_no = datepart(week, datecol) - datepart(week, dateadd(month, datediff(month, 0, datecol), 0)) + 1 from @sample) dpivot( count(week_no) for week_no in ([1], [2], [3], [4], [5], [6]) ) p
KH[spoiler]Time is always against us[/spoiler]