Previous Topic

Next Topic

Book Contents

_CompareDatesWithRange

Compares two date times to determine whether they are within a specified range of each other.

Syntax

_CompareDatesWithRange(date1,date2,datePart,rangeMin,rangeMax)

Parameters

Parameters for _CompareDatesWithRange

Parameter

Definition

Data type

date1

First date to use.

PFDateTime

date2

Second date to use.

PFDateTime

datePart

Date part used to calculate the interval between date1 and date2.

Integer

rangeMin

Minimum number in the range to compare with the interval between date1 and date2.

Integer

rangeMax

Maximum number in the range to compare with the interval between date1 and date2.

Integer

Returns

True or False (Boolean), indicating whether the first date time is within the specified range of the second date time.

Notes

Example

This example checks whether a reported adverse event lasts for more than six months. The rule is defined at the form level and checks the StartDate and EndDate items in that form. This rule creates a query when an adverse event lasts more than six months.

evaluate on Form Submission

value = _CompareDatesWithRange(this.StartDate.Value, this.EndDate.Value, DateTimeParts.Months, 0, 6)

when value is false

issue query on this.EndDate: Adverse Event lasted more than six months.

Send Feedback