Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

MySQL Date and Time Exercises: Get the DATE value from a given day

MySQL Date Time: Exercise-10 with Solution

Write a query to get the DATE value from a given day (number in N).

Sample days: 730677
Output: 2000-07-11

Code:

SELECT FROM_DAYS(730677);

Sample Output:

FROM_DAYS(730677)
2000-07-11T04:00:00.000Z

 

MySQL Code Editor:

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous:Write a query to extract the year from the current date.
Next:Write a query to get the first name and hire date from employees table where hire date between '1987-06-01' and '1987-07-30'.

What is the difficulty level of this exercise?