- , , , 0 , , . , 1970 2100 :)
, ddFirstWorkDay ddLastWorkDay, , "1" . , . , , .
You can then create a query along the lines of the following to get the dates you are interested in.
SELECT ddDate from dimDates
WHERE ddDate BETWEEN 'start date' AND 'end date'
AND ddFirstWorkDay = 1
ORDER BY ddDate
LIMIT 1
SELECT ddDate from dimDates
WHERE ddDate BETWEEN 'start date' AND 'end date'
AND ddLastWorkDay = 1
ORDER BY ddDate DESC
LIMIT 1
I think this will give you what you need, although you need to execute two queries for each date range being tested, the table is small, so you need to return very quickly.
You may find the dimDates table method interesting for other uses, so I would look .. :)
source
share