• ScottPletcher (3/27/2015)


    Eirikur Eiriksson (3/27/2015)


    ScottPletcher (3/27/2015)


    Just add them and SQL will implicitly convert the varchar to a datetime anyway:

    SELECT datetime_column + time_varchar AS new_datetime, ...

    FROM ...

    Until the locale driven implicit conversion starts to produce 16:55 AM....;-)

    😎

    Hmm, how could that happen? SQL will first convert the varchar to a datetime, then add the two, right!?

    I agree with Scott. If the datatype is DATETIME, how will there be any "locale driven implicit conversion". Please post an example because, for now anyway, I have to say "Not possible" to run into such a problem.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)