Get the time portion of a date in SQL

by Andrew Jackson 11. July 2009 05: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

About Me

Andrew Jackson

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008,2009 Andrew K. Jackson

RecentComments

Comment RSS