I have the following function below.
It returns a date like Feb 29 2012 10:00PM. Is there a way to make it return the format as 2/29/2012 10:00PM
CREATE FUNCTION scrubDateString
(
-- Add the parameters for the function here
@inputDate varchar(150)
)
RETURNS DATETIME
AS
BEGIN
-- Declare the return variable here
DECLARE @Result DATETIME
-- Add the T-SQL statements to compute the return value here
DECLARE @tmpDate datetime
SET @Result = null
IF (ISDATE(@inputDate)=1)
BEGIN
SET @Result = DATEADD(HH, 5, @inputDate)
END
-- Return the result of the function
RETURN @Result
END