> 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-expressions/date-expressions/before.md).

# Before

Determine if the date is before a specified date.

The `Before` expression checks if a date is b**efore** the specified date.&#x20;

{% hint style="warning" %}
**IMPORTANT** Any time part of the date is ignored during comparison.
{% endhint %}

<table data-full-width="false"><thead><tr><th>Expression</th><th align="center">Databox Value</th><th align="center">Result</th></tr></thead><tbody><tr><td><code>Before("14-10-2020")</code></td><td align="center">15-10-2020 08:00pm</td><td align="center">False</td></tr><tr><td><code>Before("20-03-2023")</code></td><td align="center">21-11-2020</td><td align="center">True</td></tr></tbody></table>

### Example 1

Check if [Company Data](/product-suite/admin/entities/databoxes/company-data.md)Databox value is before another [Company Data](/product-suite/admin/entities/databoxes/company-data.md) Databox value.

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FRmbDGSK8UUc3pZlCiYc7%2Fimage.png?alt=media&amp;token=120cbf78-1cb4-4360-be77-4601fa7e43c1" alt=""><figcaption></figcaption></figure>

Here the date value of one databox "CompanyData.Expressions.Date" is written into "Examples.Date" and the expression ""BeforeDate Fixed date" checks if "CompanyData.Expressions.Date" (15/10/2016) is before the value in the "Examples.Date.BeforeDate Fixed" (14/10/2016) expression

If true it'll display a message with True, if false then one with False.

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FdvuSxSrNJz01zG5PXl3s%2Fimage.png?alt=media&amp;token=d2698a1f-4a5c-4386-99eb-47393d018fd6" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FMC1wKiuMNsX2w5kKC2Bt%2Fimage.png?alt=media&amp;token=29a507a6-1e4b-4762-9508-9c4e72c1f37d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FEIOSb1JBV34tIJ4uVk3k%2Fimage.png?alt=media&amp;token=c26b0c92-e914-4c10-a9c6-db934e3a59fe" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FLj6dW5jRnty9fE7WZCxk%2Fimage.png?alt=media&amp;token=b34b3f55-3e3c-4b08-b0a4-27430da87de8" alt=""><figcaption></figcaption></figure>

### Example 2

Check if a [Company Data](/product-suite/admin/entities/databoxes/company-data.md)Databox value is before a user entered value.

The same as the above example but in this example it checks if "CompanyData.Expressions.Date" is before a user entered date.&#x20;

The user enters a date into "Script.Date01". "CompanyData.Expressions.Date" then writes 15/10/2016 into Examples.Date and is evaluated against the expression "Before Date01"

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FlxkjXHnHhx3qIYviBzQz%2Fimage.png?alt=media&amp;token=493d9816-20e9-48de-9bdf-26ef7fe989d8" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FVG7Jgyigasp06RLICllY%2Fimage.png?alt=media&amp;token=7736c0f6-20a7-48fa-b959-76ff34b31d44" alt=""><figcaption></figcaption></figure>

So if 17-10-2016 is entered it returns true as shown below\...

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2F3DPokc5Nl0Jjn8NO4Qpa%2Fimage.png?alt=media&amp;token=a383b6f6-fcca-4c55-8400-835954d36089" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FhEc5sKS4n0AhQUHiopbS%2Fimage.png?alt=media&amp;token=49b2348e-5576-44f3-accf-4fcf43076147" alt=""><figcaption></figcaption></figure>

### Example 3

Check if a user entered value is before another user entered value.

As the examples above but this compares two date values that are both user entered.

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2F3R6LYvyCivzCGR5DjFbN%2Fimage.png?alt=media&amp;token=15df725f-1e9a-41db-b34d-1a0ac1e0ac52" alt=""><figcaption></figcaption></figure>

User enters dates into "Script.Date01" and "Script.Date02". An expression "Before Date01" then runs against the value entered in Script.Date02 and it returns true or false.

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FFbBFY9j97c5pXlZTwrE8%2Fimage.png?alt=media&amp;token=e1f8c864-ae53-4905-9dd5-0c4bc017f257" alt=""><figcaption></figcaption></figure>

Below are examples of the returns of true and false.

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2Fr8dIPB6EA32i5TrFo1wO%2Fimage.png?alt=media&amp;token=62f3cdfb-8e64-46ab-8a57-d66fab2fdb0b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FceF3Lazd31NpEkw6PDNn%2Fimage.png?alt=media&amp;token=ddba2cb3-16b7-4a0b-85e9-6e3a0539fa61" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FHy5yzD7AGE6uTPuqjlzA%2Fimage.png?alt=media&amp;token=26b53a8a-f520-48dc-9495-38ae9a0839eb" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2F9Czls3MEuxYbXuaNQWpS%2Fimage.png?alt=media&amp;token=a9ff02df-edb9-4da6-9143-d4a909a84a77" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FTvuoCJJ7Aqt1gLJaIkm8%2Fimage.png?alt=media&amp;token=d9786c5f-d536-41f8-a013-5d46af25d52d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FrrfpPdxGOnuZKxXPD2nT%2Fimage.png?alt=media&amp;token=65c8bad9-5684-4df8-8457-3355f07f1fc7" alt=""><figcaption></figcaption></figure>
