- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
In MySQL, how we can compute date by providing the year, week number and day of the week? day of the week?
152 Lectures 16 hours
87 Lectures 5.5 hours
We can compute the date as follows −
mysql> SET @year=2017, @week=15, @day=4; Query OK, 0 rows affected (0.00 sec)
The above query will pass the value’2017’ ,’15’, ‘4’ in ‘year’, ’week’ and ‘day’ variables respectively. Then after applying the formula in the query below, we can get the date.
mysql> SELECT Str_To_Date( Concat(@year,'-',@week,'-',If(@day=7,0,@day) ), '%Y-%U-%w' ) AS Date; +--------------+ | Date | +--------------+ | 2017-04-13 | +--------------+ 1 row in set (0.00 sec)
- Get the week number in MySQL for day of week?
- Day of the Week in C++
- Get Day Number of Week in Java
- Crontab day of the week syntax on Linux
- Get the day of week for a particular date in Java
- How to get day of month, day of year and day of week in android using offset date time API class?
- Group by day/month/week based on the date range in MongoDB
- Get the Day of the Week from Today's Date in Java
- How to get first day of the week using Python?
- Java Program to get the day of the week from GregorianCalendar
- Python Pandas - Get the Day of the week the period lies in
- Formatting day of week using SimpleDateFormat in Java
- How to return the day of the week in the specified date according to universal time?