Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2002
    Posts
    229

    Unanswered: Time part stripped from datetime data when zero

    It seems like when selecting a Datetime field through ADO, I'm getting for instance "2007-01-03 14:20:15.123" if the time part is not zero, but just
    "2007-01-03" if the time part is "00.00.00.000" .
    This is perfectly ok in my case (I'm just storing the date part
    when INSERT:ing) - my only concern is; can I always rely upon this?

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    You get different formats in ADO from the same column, depending upon the data?

    That seems odd to me, but if so then it is an ADO issue and has nothing to do with SQL Server (as long as your dates are actually stored as datetime types and not strings...).
    If it's not practically useful, then it's practically useless.

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

  3. #3
    Join Date
    Jul 2002
    Posts
    229
    Yes, in a way - depending on whether the time part (also called the fractional part?) is zero or not.

    Could you recommend any good forum for ADO issues?

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    If it's not practically useful, then it's practically useless.

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

  5. #5
    Join Date
    Jul 2002
    Posts
    229

    Datetime value when fractional (hours etc) part is zero

    It seems like when selecting a Datetime field through ADO, I'm getting for instance "2007-01-03 14:20:15.123" if the time part is not zero, but just
    "2007-01-03" if the time part is "00.00.00.000" .
    This is perfectly ok in my case (I'm just storing the date
    part when INSERT:ing) - my only concern is; can I always rely upon this?

  6. #6
    Join Date
    Jul 2002
    Posts
    229
    Thanks, Blindman. I'll try that board.

Posting Permissions

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