SQL tutorial | Date Functions | Difference between DATEDIFF and DATEADD
HTML-код
- Опубликовано: 9 июл 2024
- In this video, we learn about some of the most important date functions in SQL Server -
Getdate()
Datediff
Dateadd
Datepart
Datename
Eomonth
Examples of implementations for Date Functions -
1) Find number of weekdays between two dates - Exclude Weekends
• SQL Query | Calculate ...
2) Find age from Birthdate
• SQL Tutorial | Date Fu...
3) Calculate biweekly Friday dates
• SQL Query | How to cal...
4) Find first and last day of week - method 1
• SQL Query | How to fin...
5) Find first and last day of week - method 2
• SQL Query | Date Funct...
6) How to find number of Sundays between two dates
• SQL | How to find numb...
7) How to find number of Sundays in a month
• SQL | Count number of ...
8) Convert date to full ordinal long format
• SQL | Convert date for...
9) Update only year part of the date to a constant value
• SQL | Update Year part...
How to install SQL Server for practice?
• How to install SQL Ser...
Check out the complete list of SQL Query Interview Questions -
• SQL Query Interview Qu...
Best Data Science / Analytics / SQL courses
Learn SQL Basics for Data Science Specialization
imp.i384100.net/qnXYk5
Beginners to Python Programming
skillshare.eqcm.net/GjMakm
Data Science and Business Analytics with Python
skillshare.eqcm.net/JrM1Aq
IBM Data Science Professional Certificate
imp.i384100.net/LPQvg3
Data Science Fundamentals with Python and SQL Specialization
imp.i384100.net/mgVYre
Python for Everybody Specialization
imp.i384100.net/DVz7Aj
Google Data Analytics Professional Certificate
imp.i384100.net/OR37oQ
Coursera Plus - Data Science Career Skills
imp.i384100.net/c/3299742/132...
Please do not forget to like, subscribe and share.
For enrolling and enquiries, please contact us at
Website - knowstar.org/
Facebook - / knowstartrainings
Instagram - / learn.knowstar
Linkedin - www.linkedin.com/company/know...
Email - learn@knowstar.org
Here are the examples for practicing these Date functions -
1) Find number of weekdays between two dates - Exclude Weekends
ruclips.net/video/tzfRdzgt1JM/видео.html
2) Find age from Birthdate
ruclips.net/video/VqSD35pY9e4/видео.html
3) Calculate biweekly Friday dates
ruclips.net/video/Y-Bk_gWqEqM/видео.html
4) Find first and last day of week - method 1
ruclips.net/video/lXcaqzx2v90/видео.html
5) Find first and last day of week - method 2
ruclips.net/video/0elDBuPGd6M/видео.html
6) How to find number of Sundays between two dates
ruclips.net/video/fGAuoRkaky0/видео.html
7) How to find number of Sundays in a month
ruclips.net/user/shorts0JoZjO337tA
8) Convert date to full ordinal long format
ruclips.net/user/shortsJtpLMxkp6kE
9) Update only year part of the date to a constant value
ruclips.net/user/shortscFtJdvUx_ZM
It's crazy how much value your videos give, the explanations, and just each topic you do is so unique to everyone else on YT. Very well done 👏
Glad you like them!
Very helpful. Please keep posting.
More to come!
Thanks for sharing ...your all videos arel very informative 🙏
Thanks a lot
Hi, as you are typing the function name like GetDate(), you are getting the function syntax. How to enable it in SSMS?
Can u explain nested replace with example.
Hello, There is one date column. I want to apply filter for that column. It would show the records of lask week dates only. How to do that. Any suggestions?
How to get null values when we use datediff function?
Thank you for the clear explanation.
Glad it was helpful!
Please what can i do when i get this message "'DATE_PART' is not a recognized built-in function name."
Hi madam I want SQL resume pls two yeras
Will share some tips on creating resume soon.
Thanks for making the video. Can you help me in how to get age in the firm of 30 years, 8 months, 13 days in sql. From the date of birth column. This is asked me in the previous interview
This is a very good question. Will post the answer for everyone soon! Please keep sharing these wonderful questions!
I have a very stupid question: why difference in weeks between Saturday and Sunday equal 1? Week starts on Monday, Saturday and Sunday refer to the same week of the year.
SQL Query:
SELECT DATEDIFF (week, '2023-05-27', '2023-05-28')
,DatePart (week, '2023-05-28')
,DatePart (week, '2023-05-27')
,@@DATEFIRST
Result:
1 22 22 1