Get the time portion of a date in SQL

by Andrew Jackson 11. July 2009 12:23

select cast(convert(varchar, getdate(), 108) as datetime)

Note: Code 108 returns the time portion of a date in the format hh:mm:ss

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Development | SQL

Comments are closed

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen