• CELKO (9/18/2012)


    I don't want to post it again, so Google around here for "Report_Periods"; it is a basic look-up table for temporal durations. Don't use UDFs; they screw up the optimizer, cannot port and are a bitch to maintain.

    Please ignore this stupid remark!

    Although in your case UDF is not really required, they are very helpful and useful where appropriate.

    UDF is a powerful feature of SQL Server and when UDFs implemented correctly, they do not screw up the optimiser. If you thinking to port your system into other RDBMS, believe me, having UDFs will not be your main concerns. They are not harder to maintain than stored procedures.

    Mr. Celko hates many different features of SQL Server (which he cannot comprehend) and he is very vocal about it...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]