by Dinesh Thakur Category: SQL Functions

The simplest of the date/time functions is one that returns the current date and time. In Microsoft SQL Server, the function is named GETDATE. This function has no arguments. It merely returns the current date and time. For example:

SELECT GETDATE ()

Brings back an expression with the current date and time. Since the GETDATE function has no arguments, there is nothing between the parentheses. Remember, that a date/time field is a special data type that contains both a date and a time in a single field. An example of such a value is:

2009-07-15 08:48:30

This value refers to the 15th of July 2009, at 48 minutes and 30 seconds past 8 a.m.

Related Articles of SQL






About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.