1

I'm using the query below to add 14 days to a date

SELECT DATE_ADD(Paper_Sent_Dt,INTERVAL 14 DAY) as Rem_date from Referee_History;

the date format is yyyy/mm/dd but I require it in dd/mm/yyyy format. Is it possible to convert the date format while using the DATE_ADD function??

as in, something like this

SELECT CONVERT(DATE_ADD(Paper_Sent_Dt,INTERVAL 14 DAY),%d-%m-%y) as Rem_date from Referee_History

if yes, please tell me how Thanks in advance

2 Answers 2

2

Something like this, Can you try it?

SELECT DATE_FORMAT(DATE_ADD('2014-06-06',INTERVAL 14 DAY), '%d/%m/%Y');

O/P

20/06/2014
Sign up to request clarification or add additional context in comments.

Comments

0

Your query would be something lik:

SELECT 
    DATE_FORMAT(DATE_ADD(Paper_Sent_Dt,INTERVAL 14 DAY),%d-%m-%y) as Rem_date  
FROM 
    Referee_History

To take it further, here is the article: http://davidwalsh.name/format-date-mysql-date_format

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.