How about this?
create function dbo.getdate(@id int)
returns varchar(20)
begin
declare @out varchar(20)
select @out = date
from (select 1 as id, convert(char(10), getdate(), 102) as date
union all
select 2, convert(char(10), getdate(), 104)
) as x
where id = @id
return @out
end
And then
select dbo.getdate(1)
returns 2011.08.17
and select dbo.getdate(2) returns 17.08.2011
This is it... passing parameter to getdate function, and it has to do with the getdate().
Nothing special, but maybe better answer for this question.
commented on Aug 17 2011 10:57AM