DATETIME - 4

  • Comments posted to this topic are about the item DATETIME - 4

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • Nice question, and fine explanation, but that bit about "59.005" seems to have come from a different than the rest. ๐Ÿ˜‰

    Tom

  • L' Eomot Inversรฉ (3/16/2013)


    Nice question, and fine explanation, but that bit about "59.005" seems to have come from a different than the rest. ๐Ÿ˜‰

    +1

    May be, because, it's monday it looked like too much english and a long script to read . Then, I finally decided to go on with the question .. In the end, I realised it is a question about datetime millisecond precision :w00t:

    eventually it was a worthy read ,a simple query with calm mind ...:-P

    thanks for the question

    Edit: english

    ~ demonfox
    ___________________________________________________________________
    Wondering what I would do next , when I am done with this one :ermm:

  • demonfox (3/17/2013)


    L' Eomot Inversรฉ (3/16/2013)


    Nice question, and fine explanation, but that bit about "59.005" seems to have come from a different than the rest. ๐Ÿ˜‰

    +1

    May be, because, it's monday it looked like too much english and a long script to read . Then, I finally decided to go on with the question .. In the end, I realised it is a question about datetime millisecond precision :w00t:

    eventually it was a worthy read ,a simple query with calm mind ...:-P

    thanks for the question

    Edit: english

    +2

    Also good to see sql 2012 function "DATETIMEFROMPARTS" as well.

    Thanks Ron!

    ~ Lokesh Vij


    Guidelines for quicker answers on T-SQL question[/url]
    Guidelines for answers on Performance questions

    Link to my Blog Post --> www.SQLPathy.com[/url]

    Follow me @Twitter

  • very good question to start of the week.. ๐Ÿ˜›

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • kapil_kk (3/17/2013)


    very good question to start of the week.. ๐Ÿ˜›

    :-):-):-)

    Thanks
    Vinay Kumar
    -----------------------------------------------------------------
    Keep Learning - Keep Growing !!!

  • Awesome Qtod,thank you for posting.

    (I am bursting with my doubts... but no idea where to begin...)

    so to say... there will be no row/s in the datetime column where it ends with other than these .000, .003 or .007. Like .004 turns to .003 or .129 turns in to .127.... ? .002 changes to .003?

    My main doubt is... in the BOL it says under property as "accuracy" and then the corresponding value starts with " rounded to increment..." ? what type of accuracy is this? :crazy:

    edit; fixed the "property" spell

    ww; Raghu
    --
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.

  • Raghavendra Mudugal (3/18/2013)


    Awesome Qtod,thank you for posting.

    (I am bursting with my doubts... but no idea where to begin...)

    so to say... there will be no row/s in the datetime column where it ends with other than these .000, .003 or .007. Like .004 turns to .003 or .129 turns in to .127.... ? .002 changes to .003?

    My main doubt is... in the BOL it says under property as "accuracy" and then the corresponding value starts with " rounded to increment..." ? what type of accuracy is this? :crazy:

    edit; fixed the "property" spell

    ๐Ÿ˜€ I found this out while migrating data on a datetime, that too from sybase datetime (i think it's 3 6 9 in millisecond for sybase datetime) , had to convert it to datetime2 for exactness..

    yes, it is mentioned in bol ..the accuracy and the behaviour and cost fo this accuracy ...

    so use as you wish .. and ignore as you wish ..

    ~ demonfox
    ___________________________________________________________________
    Wondering what I would do next , when I am done with this one :ermm:

  • demonfox (3/18/2013)


    so use as you wish .. and ignore as you wish ..

    ???? :w00t:

    ~ Lokesh Vij


    Guidelines for quicker answers on T-SQL question[/url]
    Guidelines for answers on Performance questions

    Link to my Blog Post --> www.SQLPathy.com[/url]

    Follow me @Twitter

  • Thanks for the question Ron. I usually do the QOTD within ten minutes of rising in the morning. So, it helps when it's short. Or, as in this case, on a basic topic. Or, when I guess correctly! :smooooth:

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • Thanks for the question. I learned this precision rounding from March 12, inner join question from Archie Flockhart's comment. ๐Ÿ™‚

    --------------------------------------------------------------------------------------
    Hai Ton
    My Db4Breakfast blog.

  • This was removed by the editor as SPAM

  • demonfox (3/17/2013)


    L' Eomot Inversรฉ (3/16/2013)


    Nice question, and fine explanation, but that bit about "59.005" seems to have come from a different than the rest. ๐Ÿ˜‰

    +1

    May be, because, it's monday it looked like too much english and a long script to read . Then, I finally decided to go on with the question .. In the end, I realised it is a question about datetime millisecond precision :w00t:

    eventually it was a worthy read ,a simple query with calm mind ...:-P

    thanks for the question

    Edit: english

    Same here... but apparently I didn't consume enough coffee before I tried to answer this one... gah my head hurts.



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]

  • Nice question.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • I'm curious: What was the point of the cursor-like WHILE and incrementing the ID by 3? Just Obfuscation? Why didn't you just write the query as:

    SELECT ID AS 'Select number', DATETIMEFROMPARTS ([Year],M,D,H,Mi,S,Ms) AS 'Datetime'

    ,CAST(S AS CHAR(2)) + ':' + CAST(Ms AS CHAR(3)) AS 'Original seconds input'

    FROM #T

Viewing 15 posts - 1 through 15 (of 30 total)

You must be logged in to reply to this topic. Login to reply