AdBlock Detected!
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.
SQL DATEPART Function |
SQL > SQL Date Functions >
Datepart Function
DATEPART is a SQL Server function that extracts a specific part of the date/time value. SyntaxThe syntax for the DATEPART function is as follows: DATEPART (part_of_day, expression)
where part_of_day can have the following:
ExamplesExample 1The SQL statement, SELECT DATEPART (yyyy, '2000-01-20');
produces the following result: 2000
Example 2The SQL statement, SELECT DATEPART (dy, '2000-02-10');
produces the following result: 41
2000-02-10 is the 41st day in the year 2000. List of SQL Date Functions
|
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.