Support

Need assistance using edc2go? We are here to help

Validation rules: Date range - specify range

Introduction

"Date range" is a validation rule that can be specified for the date (and time) field.

With the "date range" validation rule, you can:
  • define a field as a 'Date', 'Datetime' or 'Time' (check out this article)  
  • allow a date to be in the future (check out this article)
  • specify a minimum and/or maximum value for the field
  • specify a minimum and/or maximum value based on a linked question
  • specify a time window before and after a set range (to allow for a date outside a range to be valid if it lies in the specified time window)
This article will specify how to define a minimum and/or maximum value for a date range:

Front end: date value out of specified range

When a min and or max range is specified for a date field, edc2go will display a message whenever a date value outside the specified range is entered:
  • upon entry of a date value that lies within the specified ranges, the message will disappear without activating the query.
  • whenever the form is saved with the out of range date value, a query will be opened.


Design: specify date range

  • Make sure that your CRF has status 'Design'.
  • Go to your design area via My Studies --> CRF.
  • Go to the applicable visit and form and click the ' ✓ Date' or '+ Add validation rule' button on the right hand side of the applicable question:
A validation rules window will open.
  • On the left hand side of the window is the list of all available validation rules of that particular element type:
  • Each element type has its own set of validation rules. To see an overview of possible validation rules per element type, check out this article.

A. Specific dates


  1. For dates, times or date-times;  the check box in front of 'Date range' is checked by default.
  2. Specify the applicable MIN and/or MAX date value with the date picker for the Specific Value.
  3. For a date with a specific  MIN and MAX (see above screenshot as example), the default query text is generated as: "The date should be equal to or after [value:min] and before or equal to [value:max]". You can manually update this text as appropriate.   
  4. The 'Other settings' option allows you to specify a time window. This means that you allow date entries to be a specified number of days before and/or after the set date range. When you are working with a time field, you will be able to specify the window in hours.
  5. Click the Save button to store your specifications.

B. Date range specified by (a) linked date(s)

  1. For dates, times or date-times;  the check box in front of 'Date range' is checked by default.  
  2. Click the button in front of 'Linked question' for either the minimum (MIN field) and/or maximum (MAX field) and click the applicable 'Select' button.
  3. The 'Linked question' window will open in which the applicable visit, form and question must be specified via drop down lists that contain your CRF structure.
  4. Within the dropdown lists, there is a visual distinction between visits, forms and questions that can be selected (normal text) and those that can't (italic text). Note that the only elements that can be selected are fields with the same specification as the parent field (date, date-time or time).
  5. Select the linked question that you wish to set as minimum or maximum range for the question. The 'Select' button has now turned into a green colored 'Linked' button:
  6. The query text for this example (only MIN date specified) is generated as: "The date should be equal to or after [value:min]" .
  7. It is possible to customize the system generated query text to your own preference.
  8. You can use the labels: [value:max]/[value:min] and/or [text:max]/[text:min] to add the value or question text of the linked question.
  9. Click the 'Save' button to store your specifications.
  10. The ' ✓ Date' button indicates that a validation rule was specified on this field. Click this link in case you wish to edit the validation rule(s) for this question.
  11. The linked question is now also visible in the parent form. It has an orange colored 'Linked question' label.

Feedback and Knowledge Base