MySQL DAYNAME() function
DAYNAME() function
MySQL DAYNAME() returns the name of the week day of a date specified in the argument.
This function is useful in -
- DAYNAME() is used to group, analyze, and visualize data based on the day of the week.
- It helps in identifying patterns, trends, or variations that occur on specific days.
- In applications that involve scheduling events, DAYNAME() helps identify the day of the week on which an event is scheduled, aiding in planning and coordination.
- When plotting data on graphs or charts, DAYNAME() can be used to label the x-axis with the names of the days, making the chart more informative.
- For reservation systems, DAYNAME() helps display the day of the week when customers make reservations, facilitating booking decisions.
- DAYNAME() can be used to analyze business operations that vary by day, such as customer footfall, sales, or website traffic.
Syntax:
DAYNAME(date1)
Where date1 is a date.
Syntax Diagram:
MySQL Version: 8.0
Pictorial Presentation:
Example: MySQL DAYNAME() function
The following statement will return the name of the week day of the specified date 2008-05-15.
Code:
SELECT DAYNAME('2008-05-15');
Output:
mysql> SELECT DAYNAME('2008-05-15'); +-----------------------+ | DAYNAME('2008-05-15') | +-----------------------+ | Thursday | +-----------------------+ 1 row in set (0.01 sec)
Video Presentation:
All Date and Time Functions :
Click here to see the MySQL Date and time functions.
Previous:DAY()
Next: DAY OF MONTH()
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/mysql/date-and-time-functions/mysql-dayname-function.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics