select * from zalsk where zssj>=to_date('&top_zssj&','yyyy-mm-dd hh24:mi:ss') and zssj<=sysdate 其中top_zssj是本地包的全局变量,语句老是不对 
是不是sql server本地包不能用全局变量

解决方案 »

  1.   

    你直接这样不就可以了吗
    select * from zalsk where zssj>=to_date(top_zss,'yyyy-mm-dd hh24:mi:ss') and zssj<=sysdate
      

  2.   

    top_zss如果是字符串变量的话,直接select * from zalsk where zssj>=to_date(top_zss,'yyyy-mm-dd hh24:mi:ss') and zssj<=sysdate
    就可以了!
      

  3.   


    select   *   from   zalsk   where   zssj >=to_date(top_zss, "yyyy-mm-dd   hh24:mi:ss ")   and   zssj <=sysdate ;