belong to the FLOAT data type. Calculates the square root of n. SQRT(n) Example: SELECT SQRT(9) = 3 Returns the square of the given expression. SQUARE(n) Example: SELECT SQUARE(9) = 81 Calculates the tangent of n. n and TAN(n) the resulting value belong to the FLOAT data type. Date functions calculate the respective date or time portion of an expression or return the value from a time interval. Transact-SQL supports the following date functions: Function Explanation Returns the current system date and time. Example: GETDATE() SELECT GETDATE() = 2008-01-01 13:03:31.390 Returns the specified part item of a date date as an integer. Examples: SELECT DATEPART(month, '01.01.2005') = 1 (1 = January) SELECT DATEPART(weekday, '01.01.2005') = 7 (7 = Sunday) Returns the specified part item of the date date as a character string. DATENAME(item, Example: date) SELECT DATENAME(weekday, '01.01.2005') = Saturday Calculates the difference between the two date parts dat1 and dat2 and returns the result as an integer in units specified by the value item. Example: SELECT DATEDIFF(year, BirthDate, GETDATE()) AS age FROM employee; -> returns the age of each employee.
belong to the FLOAT data type. SQRT(n) Calculates the square root of n. Example: SELECT SQRT(9) = 3 SQUARE(n) Returns the square of the given expression. Example: SELECT SQUARE(9) = 81 TAN(n) Calculates the tangent of n. n and the resulting value belong to the FLOAT data type. Date functions calculate the respective date or time portion of an expression or return the value from a time interval. Transact-SQL supports the following date functions: Function Explanation GETDATE() Returns the current system date and time. Example: SELECT GETDATE() = 2008-01-01 13:03:31.390 Returns the specified part item of a date date as an integer. Examples: SELECT DATEPART(month, '01.01.2005') = 1 (1 = January) SELECT DATEPART(weekday, '01.01.2005') = 7 (7 = Sunday) DATENAME(item, date) Returns the specified part item of the date date as a character string. Example: SELECT DATENAME(weekday, '01.01.2005') = Saturday Calculates the difference between the two date parts dat1 and dat2 and returns the result as an integer in units specified by the value item. Example: SELECT DATEDIFF(year, BirthDate, GETDATE()) AS age FROM employee; -> returns the age of each employee.
1.0%20SQL-SERVER_Notes.docx