假设参数为月份mm(整数,1~12),那个字段为rq,则条件为: where (month(rq)=mm and day(rq)>=10) or (month(rq)=mm+1 and day(rq)<10) or (mm=12 and month(rq)=1 and day(rq)<10)
select count(1) from table where convert(varchar(10),f_date,102)>='2003.08.10' and convert(varchar(10),f_date,102)<='2003.08.10'
select count(*) from table where f_date between '2003.08.10' and '2003.08.10'
select sum(case when [date] between '2002-12-10' and '2003-1-10' then 1 else 0 end) as 'data1',sum(case when [date] between '2003-1-10' and '2003-2-10' then 1 else 0 end) as 'data2',...,sum(case when [date] between '2003-11-10' and '2003-12-10' then 1 else 0 end) as 'data12' from yourtable
where (month(rq)=mm and day(rq)>=10) or (month(rq)=mm+1 and day(rq)<10) or (mm=12 and month(rq)=1 and day(rq)<10)
and convert(varchar(10),f_date,102)<='2003.08.10'