Examples: Creating a field to display dates and times

Tracking modification dates

You want to track the dates on which purchase requisitions are created and modified. On the Purchase Requisition form, you create a computed-when-composed Time field called CreationDate with the formula "@Created." This date always shows the date the author first saves the document. To track editing dates, you also created a computed Time field called ModifiedDate with the formula "@Modified." This date is the same as the CreationDate the first time the document is saved but is updated automatically each time the document is modified. For read-only documents, you can use the formula "@Accessed" to determine the last time the document was accessed.

Determining the daily age of a document

In your Service Tracking database, you want to track the age of request documents. On the Request form, you create three fields to calculate the information.

The first field is a computed Time field called DateCreated containing this formula:

@Created

The second field is a Time field named CurrentDate containing this formula:

@Now

The third field is a computed Numbers field that is calculated by this formula, which uses the values from the previous two fields:

@Abs(@Integer((CurrentDate - DateCreated) / (60 * 60 * 24)))

Notes® stores dates as a number of seconds, so that number is converted to days by dividing it by (seconds per minute [60]) * (minutes per hour [60]) * (hours per day [24]).