Quantcast
Channel: SharePoint Comic
Viewing all articles
Browse latest Browse all 23

Date and Time in a SQL Statement (DateTime)

$
0
0

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)


Viewing all articles
Browse latest Browse all 23

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>