建自定义函数@RTN_Str=year(@inputDate)+'年'+month(@inputDate)+'月'+day(@inputDate)+'日'
Return @RTN_Str------查询中使用select dbo.YourFunctionName(ddate) from operation_head

解决方案 »

  1.   

    1:
    select convert(varchar(10),getdate(),126)
    --  2002-12-092:没有直接使用的函数
      

  2.   

    to CrazyFor(Fan):
    建自定义函数
    @RTN_Str=year(@inputDate)+'年'+month(@inputDate)+'月'+day(@inputDate)+'日'
    Return @RTN_Str
    能否帮我写完整一些,我不懂怎么写完整的代码。
    function ChangeDate(@inputDate)
    begin
    @RTN_Str=year(@inputDate)+'年'+month(@inputDate)+'月'+day(@inputDate)+'日'
    Return @RTN_Str
    end 
    是这样吗?变量怎么定义?
      

  3.   

    select convert(char,getdate(),23)