Add a Time column and a Date column together?

  • Jeff Moden wrote:

    8<

    >8

    Also, just to be sure, the OP stated that they weren't the ones that are responsible for the poor datatyping that you're correctly talking about.  A 3rd party is providing the data and they, apparently, can't be compelled to make the change that needs to happen and that's why the OP asked for a bit of help.

    Depending on the frequency of use, many reports wanting the proper datetime output for instance, would abstracting your code into an Indexed View have merit here, for ease/speed of future use?

    "Knowledge is of two kinds. We know a subject ourselves, or we know where we can find information upon it. When we enquire into any subject, the first thing we have to do is to know what books have treated of it. This leads us to look at catalogues, and at the backs of books in libraries."
    — Samuel Johnson
    I wonder, would the great Samuel Johnson have replaced that with "GIYF" now?

  • Hi all,

    Thank you everyone for your input, it works perfectly.

    Your speed and responses have been fantastic.

    I also have a question on Splitting values, but i will post that in a new thread.

    Thanks again !!!!!!!!

  • david.edwards 76768 wrote:

    Jeff Moden wrote:

    8<

    >8

    Also, just to be sure, the OP stated that they weren't the ones that are responsible for the poor datatyping that you're correctly talking about.  A 3rd party is providing the data and they, apparently, can't be compelled to make the change that needs to happen and that's why the OP asked for a bit of help.

    Depending on the frequency of use, many reports wanting the proper datetime output for instance, would abstracting your code into an Indexed View have merit here, for ease/speed of future use?

    Yes.  I was going to suggest adding a persisted computed column to the 3rd party table and test to see if it breaks their code but, yeah, an indexed view would probably work a treat here.  Great suggestion.  I just hate the unnecessary duplication of data cause by 3rd party lunacy. 😀

    --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)

  • rkelly58 wrote:

    Hi all,

    Thank you everyone for your input, it works perfectly.

    Your speed and responses have been fantastic.

    I also have a question on Splitting values, but i will post that in a new thread.

    Thanks again !!!!!!!!

    Thank you for the feedback.  I also know that you'll get some pretty good help when it comes to questions about "splitting values".

    --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)

Viewing 4 posts - 16 through 18 (of 18 total)

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