Input Parameters @GivenDate DATETIMEFor this you can pass the value you get from the system function GETDATE().CREATE FUNCTION dbo.DateFormat_8th_february_2010( @GivenDate DATETIME)RETURNS VARCHAR(50)/*Created by Alwyn Duraisingh.M on 9th July 2010Purpose: To get the dateformat like 9 th July 2010*/ASBEGIN DECLARE @ConvertedDate VARCHAR(50) SELECT @ConvertedDate = CASE LEFT(Dates, 2) WHEN '11' THEN REPLACE(Dates, '11 st', '11 th') WHEN '12' THEN REPLACE(Dates, '12 nd', '12 th') WHEN '13' THEN REPLACE(Dates, '13 rd', '13 th') ELSE Dates END FROM ( SELECT CONVERT(VARCHAR(2), DAY(@GivenDate)) + ' ' + CASE RIGHT(CONVERT(VARCHAR(2), DAY(@GivenDate)), 1) WHEN '1' THEN 'st' WHEN '2' THEN 'nd' WHEN '3' THEN 'rd' ELSE 'th' END + ' ' + DATENAME(MM, @GivenDate) + ' ' + CONVERT(VARCHAR(4), YEAR(@GivenDate)) AS Dates ) a RETURN @ConvertedDate ENDYou can execute the function bySELECT dbo.DateFormat_8th_february_2010(GETDATE())Result: 9 th July 2010The result is because i executed the query on 9th July 2010it will vary according to the current date.