There are many functions and tools available to database professionals that can solve data math challenges, regardless of complexity. A recent problem came across my desk that called for not only a valid solution, but one that performs as optimally as possible when included in a scalar User-Defined-Function (UDF).
This left me asking: How often these problems impact us and what general solutions can we find that may solve them more easily for us?
The impetus for this was a simple question, “How many instances of days occur between two dates?”. For example: “How many Mondays were there between