Include end date on a history record?

  • Thanks Lynn and pmohan for the code you posted. I took it pretty much as is, and have been able to create a view that makes it look for all the world like I'm actually storing the end date. I will probably spend the next two weeks actually deciphering the thought process behind pmohan's code. And Lynn, having the CTE logic will be very helpful once we move to a new version of SQL Server.

    And Jeff, I was so intrigued by your comment about the normalized form including the storing the end date. To read discussions about normalization, I get the impression that everyone agrees what normalized is, they just don't agree on how normalized the data should be. I can see your point about not wanting to use one field to answer two questions, but I also keep coming back to the philosophy that a man with one watch always knows what time it is, a man with two is never sure.

    Again, my thanks and appreciation for your assistance.

    Mattie:)

  • Glad we could help, and thanks for the feedback.

    😎

  • MattieNH (3/7/2008)


    And Jeff, I was so intrigued by your comment about the normalized form including the storing the end date. To read discussions about normalization, I get the impression that everyone agrees what normalized is, they just don't agree on how normalized the data should be. I can see your point about not wanting to use one field to answer two questions, but I also keep coming back to the philosophy that a man with one watch always knows what time it is, a man with two is never sure.

    Heh... ok... let me turn that around on you... isn't a column that serves two purposes like wearing two watches? 😉

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

  • Depends on why you wear two watches. Soccer refs wear two watches out on the field (I do).

    😎

  • Heh... ok... let me turn that around on you... isn't a column that serves two purposes like wearing two watches? 😉

    Jeff,

    I don't think so, but since I didn't think that storing the end date was normalized, that's not surprising.

    In my years as a developer, I've always had users who wanted to store the same information in multiple forms or locations. And inevitably, data that should be the same gets out of sync. So while the man with one watch may not have any idea of what time it really is, he doesn't have to spend any effort figuring out which watch is right, and why the other watch is wrong.

    Mattie

  • MattieNH (3/7/2008)


    Heh... ok... let me turn that around on you... isn't a column that serves two purposes like wearing two watches? 😉

    Jeff,

    I don't think so, but since I didn't think that storing the end date was normalized, that's not surprising.

    In my years as a developer, I've always had users who wanted to store the same information in multiple forms or locations. And inevitably, data that should be the same gets out of sync. So while the man with one watch may not have any idea of what time it really is, he doesn't have to spend any effort figuring out which watch is right, and why the other watch is wrong.

    Mattie

    Heh... then I agree to disagree with you. In my eyes, a column with two purposes IS (to use your analogy) like a man wearing two watches.

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

  • Please go with the enddate column in the table rather than calculating it separately. This is less pain to database and also it will give fast retrieval.

Viewing 7 posts - 16 through 21 (of 21 total)

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