建自定义函数@RTN_Str=year(@inputDate)+'年'+month(@inputDate)+'月'+day(@inputDate)+'日'
Return @RTN_Str------查询中使用select dbo.YourFunctionName(ddate) from operation_head
Return @RTN_Str------查询中使用select dbo.YourFunctionName(ddate) from operation_head
select convert(varchar(10),getdate(),126)
-- 2002-12-092:没有直接使用的函数
建自定义函数
@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
是这样吗?变量怎么定义?