What is the use of DATEPART function in Sql Server?

 Posted by vishalneeraj-24503 on 2/3/2015 | Category: Sql Server Interview questions | Views: 1360 | Points: 40
Answer:

DATEPART function is used to get part of the specified date.
Syntax:
DATEPART(datepart,date);

Where, datepart specifies the part of the date to return.
date is an expression that returns a datetime or smalldatetime value, or a character string in a date format.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response