Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    11

    Unanswered: got seconds but need minutes

    I have a result that comes out in number of seconds, but need to see it converted to minutes and hours and seconds. Is there a convert function that would do this?

    Thanks,
    Dan

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Code:
    DECLARE @x int
    
    SELECT @x = 3600 + 1800
    
    SELECT @x/60/60 AS Hours,CONVERT(Int,(@x/60.00/60.00-@x/60/60)*60) AS Seconds
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'm rather fond of:
    PHP Code:
    SELECT Convert(CHAR(8), DateAdd(second45296'0:00'), 8
    -PatP

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    I like it!

    Simple, Elegant....
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

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