How to get Date part from given date or current date?

 Posted by Rajesh_Kumar on 2/18/2014 | Category: Sql Server Interview questions | Views: 495 | Points: 40
Answer:

Select Convert(Varchar(10),Getdate(),101) as date_only;


101 is a format provided by dot net for extracting date part from given date in sql server.

Output:02/18/2014 i.e. MM/dd/yyyy


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response