How to get the Date Part of a Date/Time Value?

 Posted by Vishalneeraj-24503 on 5/16/2015 | Category: Sql Server Interview questions | Views: 1253 | Points: 40
Answer:

Just write below query to get date part:-
SELECT CAST(FLOOR(CAST(GETDATE() AS FLOAT)) AS DATETIME) AS 'Date Part';


OUTPUT
2015-05-16 00:00:00.000


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response