in reply to counting number of working days
Since "working days" can be a substantial headache to define algorithmically, one brute-force method is to create a table (in Oracle, in your case) that stores attributes for dates. It's ugly, but it works, and it lets you do things like
This approach lets you have columns for stuff likeSELECT COUNT(*) FROM dates WHERE dates.ymd > ? AND dates.ymd < ? AND dates.isWorkingDay = 1
The downside of this approach is performance. The upside is that the table is fairly small, and once you've got it populated, everyone who cares gets consistent results. It's also possible to extend the table by adding columns.
Those who've done any data warehousing (quick intro here) will recognize this as a dimension table.
|
|---|