2007-10-02 (first published: 2002-06-20)
15,421 reads
CREATE FUNCTION dbo.fn_Today(@input datetime) RETURNS varchar(50) AS BEGIN declare @input='10/01/2003' declare @output varchar(50) select @output= 'Today is ' + DATENAME(mm,@input) + ' ' +DATENAME(dd,@input) + ','+ DATENAME(dw,@input) + '' + ' the ' + DATENAME(dy,@input)+ 'th' + ' ' +'Day' +' Of ' + DATENAME(yy,@input) RETURN (@output) END select dbo.fn_today('10/01/2003')