SQLServer Functions Scalar Single Row
Date And Time
In SQL, you use date and time data types to store calendar information. These data types include the time, date, smalldatetime, datetime, datetime2, and datetimeoffset. Each data type has a specific format.
The DATENAME function returns the name or value of a specific part of the date.
You use the GETDATE function to determine the current date and time of the computer running the current SQL instance. This function doesn't include the time zone difference.
The DATEDIFF function returns the difference between two dates.
In the syntax, datepart is the parameter that specifies which part of the date you want to use to calculate difference. The datepart can be year, month, week, day, hour, minute, second, or millisecond. You then specify the start date in the startdate parameter and the end date in the enddate parameter for which you want to find the difference.
SalesOrderID Processing time
The DATEADD function enables you to add an interval to part of a specific date.