MySQL Forums
Forum List  »  General

convert mssql function to mysql function
Posted by: Romilton Fernando
Date: December 23, 2011 04:48AM

CREATE FUNCTION GetWeekDayNameOfDate
(
@Date datetime
)
RETURNS nvarchar(50)
BEGIN

DECLARE @DayName nvarchar(50)

SELECT
@DayName =
CASE (DATEPART(dw, @Date) + @@DATEFIRST) % 7
WHEN 1 THEN 'Sunday'
WHEN 2 THEN 'Monday'
WHEN 3 THEN 'Tuesday'
WHEN 4 THEN 'Wednesday'
WHEN 5 THEN 'Thursday'
WHEN 6 THEN 'Friday'
WHEN 0 THEN 'Saturday'
END

RETURN @DayName

END

GO

please convert this code to mysql function please help me ...

With regards,
A.Romilton Fernando....

Options: ReplyQuote


Subject
Written By
Posted
convert mssql function to mysql function
December 23, 2011 04:48AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.