MySQL Forums :: General :: convert mssql function to mysql function


Advanced Search

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 Romilton Fernando 12/23/2011 04:48AM
Re: convert mssql function to mysql function Rick James 12/24/2011 10:12AM
Re: convert mssql function to mysql function Romilton Fernando 12/27/2011 11:33PM
Re: convert mssql function to mysql function Romilton Fernando 12/28/2011 04:13AM
Re: convert mssql function to mysql function Rick James 12/29/2011 11:32AM


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.