declare @yyyy char(4) , @mm char(2) set @yyyy = '2011' set @mm = '04' --螳 4 12 企朱.. ;with t as ( select convert(date, '2011-04-12') date_key union all select convert(date, '2011-03-01') date_key union all select convert(date, '2011-02-01') date_key ) select left(date_key,7) + case when convert(char(7), getdate()-1, 121) = @yyyy + '-' + @mm and left(date_key,7) = @yyyy + '-' + @mm then '(' + @yyyy + '-' + @mm + '-01 ~ ' + convert(char(10), getdate()-1, 121) + ')' else '' end from t order by 1 /* 2011-02 2011-03 2011-04(2011-04-01 ~ 2011-04-12) */