select '2003/01/01' < '2003/03/03'  格式一定相同 ‘yyyy/mm/dd’
convert(char(10),getdate(),111) 显示格式‘yyyy/mm/dd’

解决方案 »

  1.   

    ?-->  select * from 人员档案 a,可选项目表 b  where b.项目类型='报表统计开始日期' and  a.进单位时间>=convert(char(8),b.项目名称,112)
      

  2.   

    select * from 人员档案 a,可选项目表 b  where b.项目类型='报表统计开始日期' and  a.进单位时间>=convert(char(8),b.项目名称,112)
    select convert(char(8),getdata(),112)
    select convert(char(8),getdata(),120)
      

  3.   

    select * from b where 日期<cast((select 日期 from a where 编号=@编号) as datetime)
      

  4.   

    select convert(char(8),getdate(),112)
    select convert(char(8),getdate(),120)