AGE IN #SQL #sqlserver #database #dba #dev #dataengineering #dataanalytics #datascience #programming

preview_player
Показать описание
Here is a good way to calculate the Age in SQL SERVER!

DATEDIFF() - This function returns the count (as a signed integer value) of the specified datepart boundaries crossed between the specified startdate and enddate.

DATEADD() - This function adds a number (a signed integer) to a datepart of an input date, and returns a modified date/time value. For example, you can use this function to find the date that is 7000 minutes from today: number = 7000, datepart = minute, date = today.
Рекомендации по теме