declare @dData datatimeselect @dData = getdate() --指定日期select count(*) from 表 where 日期字段 between @dData and DATEADD(mm, 1, @dData)
:_)

解决方案 »

  1.   

    假设参数为月份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)
      

  2.   

    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'
      

  3.   

    select count(*) from table where f_date between '2003.08.10' and '2003.08.10'
      

  4.   

    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