There are list of DATE Function which follows:
1) DATEADD() :
This function is used to add Date/Time Interval to Date.
Syntax : DATEADD(Interval date, value, Date)
Example : The following query will add 1 month to Input date.
SELECT DATEADD(Month, 1, '2019/11/11') AS Date
Output
2) DATEDIFF() :
This function is used to return difference between two dates.
Syntax : DATEDIFF(Interval, Start_date, End_Date)
Example : The following query will return no. of days between two Input dates.
SELECT DATEDIFF(Day, '2019/09/11', '2019/11/11') AS Date
Output
3) GETDATE() :
This function is used to return current system date and time.
Syntax : GETDATE()
Example : The following query will return current date and time of system on which SQL is running.
SELECT GETDATE() AS Date
Output
4) DATEPART() :
This function is used to return date part of date as an Integer.
Syntax : DATEPART(Interval, Inputdate)
Example : The following query will return year of date.
SELECT DATEPART(Year, '2019/09/11') AS Date
Output
5) DATENAME() :
This function is used to return date part of date as an String.
Syntax : DATENAME(Interval, Inputdate)
Example : The following query will return month of date.
SELECT DATENAME(Month, '2019/09/11') AS Date
Output
6) CURRENT_TIMESTAMP :
This function is used to return date and time.
Syntax : CURRENT_TIMESTAMP
Example : The following query will return current date and time.
SELECT CURRENT_TIMESTAMP;
Output
7) DAY() :
This function is used to return days of date.
Syntax : DAY(InputDate)
Example : The following query will return days of date.
SELECT Day('2019/09/11') as Days
Output
8) MONTH :
This function is used to return month of date.
Syntax : Month(InputDate)
Example : The following query will return month of date.
SELECT Month('2019/09/11')
Output
9) YEAR() :
This function is used to return year of date.
Syntax : YEAR(InputDate)
Example : The following query will return year of date.
SELECT YEAR('2019/09/11')
Output
10) SYSDATETIME() :
This function is used to return date and time of Server.
Syntax : SYSDATETIME()
Example : The following query will return current date and time of server.
SELECT SYSDATETIME() AS SysDateTime;
Output
11) DATEFROMPARTS() :
This function is used to return date from specified parts.
Syntax : DATEFROMPARTS(year,month,day)
Example : The following query will return date.
SELECT DATEFROMPARTS(2019, 10, 11)
Output
If you want to sell your readymade software to the genuine clients or businessman, list your software with details and demo links.
Clients will find it using our advanced search filter and will contact you directly.
No any charge for the product lsiting.