Write a query to display schedule id and date in the format of yyyy-mm-dd and name the column as formatteddate. Display record in ascending order by schedule id.
Answers
Answered by
5
Answer:
Explanation:
To display schedule id and date in the format of yyyy-mm-dd we need to use the function -
SELECT DATE_FORMAT(CURDATE(), '%d/%m/%Y') today; ( or whichever date)
—syntax :: select date_format (date_ordered,%d-%m-%Y') from your_table;
>>Use Alter Table function to date format %d/%m/%Y (tip : Y->YYYY and y->YY)
>> SELECT DATE_FORMAT(column_Date ,'%d-%m-%Y') AS DateofEntry FROM userdata;
We can also use the style codes if we have standard date format
Similar questions
Environmental Sciences,
5 months ago
English,
5 months ago
English,
5 months ago
Computer Science,
10 months ago
Math,
10 months ago
Physics,
11 months ago
Physics,
11 months ago