> For the complete documentation index, see [llms.txt](https://docs.keyfax.biz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keyfax.biz/product-suite/admin/databox-examples/business-days.md).

# Business Days

Demonstrates how to calulcate business / working days. Please check with Omfax Systems support before following this guide as this example below relies on...

* The `syHolidays` table being populated with all public holidays
* The SQL function `fn_DueDate` being present (possibly not the case in older Keyfax versions)&#x20;

Two script steps demonstrate this; the first asks for the number of business days and stores it in a Databox named Script.Business Days:

<figure><img src="/files/cpgvkHGVU97fclCE8CCg" alt=""><figcaption><p>Example script demonstrating Business Days calculation</p></figcaption></figure>

This [SQL Query](/product-suite/admin/entities/databoxes/sql-query.md) Databox executes the function `fn_DueDate`, supplying the Databox above and a country code (**EN**gland). The expression **PlusBusinessDays** is the one of interest:&#x20;

<div align="left"><figure><img src="/files/7NpOXVtgI0KT29B152zP" alt=""><figcaption><p>SQL Databox</p></figcaption></figure></div>

This Message references both Databoxes:

<div align="center"><figure><img src="/files/T0iIjIZPZRvZl5mejzEC" alt=""><figcaption><p>Message to display the results</p></figcaption></figure></div>

For example...

<figure><img src="/files/3DghILU5YsqFHRimq746" alt=""><figcaption><p>The results as seen by the end-user</p></figcaption></figure>
