select * from user_login where convert(varchar(10),getdate(),120)<convert(varchar(10),end_date,120)
试试看

解决方案 »

  1.   

    to Cityfire(青团子):
    跟原来的一个样子。
      

  2.   

    select *from user_login where convert(varchar(10),getdate(),120)<convert(varchar(10),end_date,120)就可以了
      

  3.   

    --測試
    create table BB(AA datetime)
    insert BB  select   '2004/09/05'
    union all  select '2004/09/03'
    union all  select '2004/09/10'
    union all  select '2004/10/10'
    union all  select '2004/10/01'
    go 
    select AA   from BB where convert(varchar(10),getdate(),120)<convert(varchar(10),AA,120)(影響 4 個資料列)
      

  4.   


    --測試
    create table BB(end_date varchar(100))
    insert BB  select   '2004-09-02'
    union all  select '2004-09-03'
    union all  select '2004-09-10'
    union all  select '2004-10-10'
    union all  select '2004-10-01'
    go 
    select * from BB where convert(varchar(10),getdate(),120)<end_date
    go
    drop table BB--结果
    2004-09-10
    2004-10-10
    2004-10-01
      

  5.   

    select *from user_login where cast(convert(varchar(10),getdate(),120) as datetime)<end_date试试对了,你的end_date是什么类型的