I\'ve seen different version of this kind of function for other coding languages (Python, jQuery, etc.) but not for SQL. I have a procedure that needs to have a date calcul
I've always achieved this with a static table of dates from roughly 5 years in the past to 10 in the future, each date being marked with 'working day' status and sometimes other flags as required. Previously using MS-SL server I would achieve this quickly with a WHILE loop, I think MySQL supports the same syntax
WHILE (condition)
BEGIN
INSERT date
END
To create the table either use the Enterprise Manager UI or something like
CREATE TABLE DateTable
(
actual_date datetime NOT NULL,
is_holiday bit NOT NULL
)