Thursday, November 29

SQL- User Defined Function For Date Format ( DD_Mon_YYYY )



Function for user defined date format ( DD_Mon_YYYY )
create function dbo.CustomDate_DD_MON_YYYY(@datee varchar(255))
returns varchar(255)
As
begin

SET @datee = (CONVERT(VARCHAR(11), GETDATE(), 106)

return @datee

end

**This function allows you to get result-set of date field in DD_Mon_YYYY format. 
i.e. 07 oct 2012