select CONVERT(varchar(10), getDate(),120) --不要时间2002-1-1
select convert(char(8),getdate(),112) ----20020101
select convert(char(8),getdate(),108)  ---06:05:05

解决方案 »

  1.   

    select CONVERT(varchar(10), getDate(),120) --不要时间2002-1-1
    select convert(char(8),getdate(),112) ----20020101
    select convert(char(8),getdate(),108)  ---06:05:05
      

  2.   

    select CONVERT(varchar(10), getDate(),120) --不要时间2002-01-01
      

  3.   

    苯办法 left(datetime类型,10)