Date and Time in a SQL Statement (DateTime)


To get the date and time for a datetime value in SQL Server, use the GetDate method.  It will return the current system date and time in the SQL Server standard internal format for datetime values.

This is a pretty useful function if you need to know the date/time in a select statement or a where clause.

SELECT GETDATE()

GO

Here is the result set:
————————-
April 10 2006   11:39    AM

(1 row(s) affected)

Comments (0)

Skip to main content