• jim.jaggers1 (8/3/2010)


    And, a question on type casting. I notice you use explicit type casting with

    Cast(Ceiling(Cast(YearDay as real)/Cast(7 as real))as int)

    and similar functions. I think the same result would be accomplished with the implicit typecasting of

    ceiling(YearDay/7.0)

    and be a little easier to read.

    Of course I am not a "real" programmer as I write code to do my job rather than as my job (though I'm considering a career change from Data Analysis to DB Developer). So it may be that real programmers find it better to explicitly control the data type rather than trusting to implicit data typing "rules".

    I tend to prefer it because it eliminates a point of failure. Also if someone else uses the code in the future and I'm not explaining it to them and I haven't commented that particular piece (I should, I know), they won't be tempted to get rid of the "pointless" .0 and end up with errors that seem inexplicable.

    --------------------------------------
    When you encounter a problem, if the solution isn't readily evident go back to the start and check your assumptions.
    --------------------------------------
    It’s unpleasantly like being drunk.
    What’s so unpleasant about being drunk?
    You ask a glass of water. -- Douglas Adams