Here are few SQL Functions which would be useful when we do some tasks dealing with dates
Dateadd: Returns a new datetime value based on adding an interval to the specified date.
Syntax: DATEADD ( datepart, number, date )
Datediff: Returns the number of date and time boundaries crossed between two specified dates.
Syntax: DATEDIFF ( datepart, startdate, enddate )
Datename: Returns a character string representing the specified datepart of the specified date.
Syntax: DATENAME ( datepart, date )
Datepart: Returns an integer representing the specified datepart of the specified date.
Syntax: DATEPART ( datepart, date )
Day: Returns an integer representing the day datepart of the specified date.
Syntax: DAY ( date )
Getdate: Returns the current system date and time in the Microsoft® SQL Server™ standard internal format for datetime values.
Syntax: GETDATE ( )
Month: Returns an integer that represents the month part of a specified date.
Syntax: MONTH ( date )
Year: Returns an integer that represents the year part of a specified date.
Syntax: YEAR ( date )
Hope this would be helpful.
