@datToday,@datBefore之间是否有数据?
可能@datToday以后才有数据

解决方案 »

  1.   

    看不出为什么不对
    insert into #NewThread select Tb.Topic_ID,Tb.Author_ID,Tb.Message,Tb.Message_date
    from tblThread as Tb 
    inner join tblAuthor as AU 
    ON AU.Author_ID = Tb.Author_ID 
    where Tb.Message_date >= @datBefore and Tb.Message_date < @datToday  and AU.Group_ID = 12
    order by Message_date'
    select * from #NewThread
    这样呢?不过好象没有什么区别
      

  2.   

    看不出有什么不对的地方
    insert into #NewThread select Tb.Topic_ID,Tb.Author_ID,Tb.Message,Tb.Message_date
    from tblThread as Tb 
    inner join tblAuthor as AU 
    ON AU.Author_ID = Tb.Author_ID 
    where  Tb.Message_date >= @datBefore and Tb.Message_date < @datToday  and AU.Group_ID = 12
    order by Message_date'
    select * from #NewThread
    这样呢?不过好象没有区别
      

  3.   

    你where后面的条件都改变了。是不是条件的原因
      

  4.   

    转换成日期型再比较convert(datetime,'2004-12-01')
      

  5.   

    恩,你先把Tb.Message_date的类型转换一下看看。