> 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

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="/files/jxWILyifBtkfecJuJ9HX" 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="/files/B6lxuWnPsHOw8ENCGrmh" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/mHLIdZC2Dx01XBXMwggZ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/oiodHCzxs8RqfNl333qK" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/kfjhg5h2DHzryby4XKD7" 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="/files/5L0lwjHGyn3hzpW4XQtR" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/yCpzLVbaXepvIK2KQ7Bw" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/zepBNbO2EU2EO0lm6qIP" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/KXW54osPh0ruancT4f9l" 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="/files/onBPKAg02DXPpZ94QCVg" 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="/files/kjwhyDopmyNGMC3UOS24" alt=""><figcaption></figcaption></figure>

Below are examples of the returns of true and false.

<figure><img src="/files/licXc7Hs3963eT9txQAZ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/XvkLwnQxUXL3Ehuc2c4G" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/MQeM8nhs3ORfvmjMKnQo" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/BfwCQhqnsEaHTftRpWlR" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Jd70X09QBK57zpBEYTl1" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/NVl1N1OXS9iUMDbpce3U" alt=""><figcaption></figcaption></figure>
