Shop calendar days

Is there a way in a query to use shop calendar days for calculations?

ex. (todays) - (DueDate) = (TotalDays)

but instead of using a regular calendar, just using working days as defined by a calendar in the system.