> 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

How to add business days to today's date.

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="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FIWYnKp5In6S58iN4XJA3%2FBusiness%20days%204.4.7.png?alt=media&amp;token=22de0c3e-6d9c-4678-bb3c-41c31ef59094" 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="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FfP4E0OeilFY3ESvJjpgJ%2F2023-05-04_11h58_50.png?alt=media&amp;token=d2aff979-c2fb-42f6-b05d-5cd868369333" alt=""><figcaption><p>SQL Databox</p></figcaption></figure></div>

This Message references both Databoxes:

<div align="center"><figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FZGJ80nOuF0QMm8R2cEJG%2F2023-05-04_12h15_37.png?alt=media&amp;token=81573b5f-99aa-4de2-aadb-b5c11c20ce51" alt=""><figcaption><p>Message to display the results</p></figcaption></figure></div>

For example...

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FOm4rK0qc1khrWUsF3DKX%2FBusiness%20days%20message%204.4.7.png?alt=media&amp;token=044142cc-8bce-4786-9287-46fe0b82cb07" alt=""><figcaption><p>The results as seen by the end-user</p></figcaption></figure>
