我想问 select * from ttt between 时间1 and 时间2 
      首先这个语句成立不?
      其次 时间1 怎么表示 2010/10/12/14/35/23 这样的嘛 
   基础问题 谢谢       SQL2000

解决方案 »

  1.   

    语句是成立的,但时间的数据格式应该为 ymd hh:mm:ss
      

  2.   

    select * from ttt  where 時間字段 between 时间1 and 时间2 
      

  3.   

    select convert(varchar(10),GETDATE(),111)+'/'+ replace(CONVERT(varchar(12) , getdate(), 108 ),':','/')
    /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    2011/10/12/14/42/21(1 行受影响)
    */
      

  4.   

    select * from ttt where 时间字段 between 时间1 and 时间2  
    --没有发现掉了where 
      

  5.   

    問題2參照日期格式
    http://msdn.microsoft.com/zh-cn/library/ms187928%28v=SQL.90%29.aspx
      

  6.   

    current_timestamp的用法:
    SELECT 'The current time is: '+ CONVERT(char(30), CURRENT_TIMESTAMP)
      

  7.   

    SELECT 'The current time is: '+ CONVERT(char(30), CURRENT_TIMESTAMP)