Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Posts
    32

    Unanswered: Datetime datatype conversion to int hhmmyy format

    Is there a way of converting a datetime data type in the form [DD/MM/YYYY HH:MMS] to an integer containing just the time in the form [HHMMSS].

  2. #2
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    SELECT REPLACE((CONVERT(VARCHAR,GETDATE(),24)),':','')

    This converts it to a varchar. You actually don't want to convert it to integer as it will drop off the leading zeros.
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •