Microsoft SQL Server

Function NameDescription
CURRENT_TIMESTAMPObtains the current date and time in the local time zone.
DateAdd(<interval>, <number>, <expression>)Adds the specified number of the interval to the date or datetime expression.
DateDiff(<interval>, <expression1>, <expression2>)Returns the specified number of intervals between the datetime in expression1 and the datetime in expression2.
DateName(<interval>, <expression>)Evaluates the expression and returns a string containing the name of the interval specified. If the interval is a month or a day of a week, the name is spelled out.
DatePart(<interval>, <expression>)Extracts the part of the date or time from the expression as specified by the interval.
Day(<expression>)Evaluates the expression ...

Get SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.