Results 1 to 4 of 4
  1. #1
    Join Date
    May 2004
    Posts
    36

    Unanswered: TimeStamp Issues

    i'm using a starttime, stoptime, duration combination of columns. i'm using datetime for the first two to get a time stamp for the start and stop. the issue is that i want to display "00:00" for start and stop time if the session has not been started yet.

    is this possible??? what is the best course of action to tackle this problem??


    thanks,
    e3witt

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Code:
    DECLARE @x datetime
    
    SELECT @x = CONVERT(varchar(10),Getdate(),101)+' 00:00:00'
    
    SELECT @x
    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
    May 2004
    Posts
    36
    thanks... i think i can make that work.

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Well, sort of...

    CONVERT(varchar(10),Getdate(),101)+' 00:00:00' is going to display midnight of the current day. Is that what you want? If you are looking for a "zero-time" setting, that's trickier. Microsoft time goes back, what 1900? Western zero-time goes back to Jesus (give or take a few years). Universal time goes back to the Big Bang, but you'll definitely need the BigInt datatype for that...

    Simpler to use NULL.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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