Hello,
I am trying to limit the results of a SQL query by date. I would like to take the current date from the system
clock, move back one day, check to make sure it's not a weekend or holiday, then use the result date to limit
the results in my Query. If the current date minus one day happens to land on a weekend, the date picked
should be the Friday before the weekend. If the current date minus one day lands on a holiday, it should be
the date before the holiday as long as it is not a Saturday or Sunday (on another holiday) .
Here is my SQL query right now.
SELECT DISTINCT (Mid(ClientDiv.Client_Division,1,3)) AS ABC, RTIClientTracker.EMB_OOB, RTIClientTracker.OOB_Fixed
FROM ClientDiv INNER JOIN RTIClientTracker ON ClientDiv.ID = RTIClientTracker.Client_Division
WHERE (((RTIClientTracker.Division_Region)='RTI') AND ((RTIClientTracker.Cut)>=Date()-1))
ORDER BY (Mid(ClientDiv.Client_Division,1,3));
It limits what it selects by using the current Date minus one day.
I need to skip over Saturdays, Sundays and Holidays.
Thank you in advance.
Linda