Results 1 to 3 of 3

Thread: Joining Date & Time

  1. #1

    Thread Starter
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Joining Date & Time

    Hey there,

    i'm joining a smalldatetime field and a nvarchar field to be a smalldatetime
    using the following

    Code:
     CONVERT(smalldatetime, CONVERT(CHAR(10), dDespatchDate, 111) + ' ' + sSTA)

    when i combine a date 02/04/2007 with a string 14:55 it results in 02/04/2007 14:55:00

    however when i combine a date 02/04/2007 with a string 00:00 it results in 02/04/2007 with no time attached...

    can someone tell me why is this
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Joining Date & Time

    That's probably just the way it is displayed, I would assume that it actually stores 00:00:00.

    If you aren't sure, try a comparison of the two.. eg: the "00:00" one, minus the "14:55" one - should give you something like "31 December 1899 09:05".

  3. #3

    Thread Starter
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: Joining Date & Time

    yeah i just noticed that i displayed the 00:00:00 inside SQL Management Studio but not inside Visual Studio Server Explorer..

    Dam confusing microsoft
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

Posting Permissions

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



Click Here to Expand Forum to Full Width