select cast(convert(char(10),getdate(),112) as datetime)

解决方案 »

  1.   

    你的结果是
    2004-04-18 00:00:00.000
    我要得是
    2004-04-18
    我的语句是
    insert into(user,regdate) values ('user',getDate())
    regdate 是 smallDateTime
    帮忙改一下。
      

  2.   

    smalldatetime,datetime 都带时间,在查询时用
    select convert(char(10),getdate(),120)
      

  3.   

    select convert(char(10),getdate(),样式) as 当前日期
    120/126:2004-04-18
    112:    20040418
    .....
    可以参考联机帮助。