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

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

Write below query:-

SELECT GETDATE() as col1,CAST(CAST(GETDATE() AS FLOAT) - FLOOR(CAST(GETDATE() AS FLOAT)) AS DATETIME) as col2;


col1
2015-04-07 15:32:28.100
col2
1900-01-01 15:32:28.097


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response