MySQL Forums
Forum List  »  Stored Procedures

Re: DAYNAME problem using CASE statement
Posted by: John Noble
Date: May 08, 2020 01:42AM

Hi Peter,

I am not seeing that behaviour. WHen I run your code it is only adding 1 day to Saturday....

set @d = '2020-5-9'; -- sat 
SELECT 
@d, DAYNAME(@d), 
CASE @d WHEN DAYNAME(@d) = "Saturday" THEN DATE_ADD(@d, INTERVAL 2 DAY) 
ELSE DATE_ADD(@d, INTERVAL 1 DAY) END as despatchDate; 

# @d, DAYNAME(@d), despatchDate
2020-5-9, Saturday, 2020-05-10

Any ideas ?

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: DAYNAME problem using CASE statement
97
May 08, 2020 01:42AM


Sorry, only registered users may post in this forum.

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.