DATETIME - Time only needed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amanjsingh
    New Member
    • Mar 2007
    • 48

    DATETIME - Time only needed

    Hi,

    I'd like to know how to delete Date part of the DATETIME in SQL Server. I currently have 12/30/1899 12:30:00 AM sort of values in the DB and would like have or use only the Time part.

    Thanks
    AJ
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Originally posted by amanjsingh
    Hi,

    I'd like to know how to delete Date part of the DATETIME in SQL Server. I currently have 12/30/1899 12:30:00 AM sort of values in the DB and would like have or use only the Time part.

    Thanks
    AJ

    Check this out.

    -- CK

    Comment

    • TimHop12
      New Member
      • Nov 2006
      • 24

      #3
      Here you go:

      Code:
      Select convert(varchar(10),getdate(),108)

      Comment

      Working...