SAP Knowledge Base Article - Public

1303981 - User warning if Begin Date Parameter is later than End Date parameter

Symptom

Crystal Reports does not intelligently inform the users if they enter a beggining date parameter later than the ending date parameter

Reproducing the Issue

1 - Create two separate date type parameters for {?BeginDate} and {?EndDate}

2 - Create your record selection formula based on those two parameters:

  {Orders.Order Date} >= {?BeginDate}
  AND
  {Orders.Order Date} <= {?EndDate}

3 - Test by entering a {?BeginDate} value later than the {?EndDate} value.

Resolution

1 - Create two separate date type parameters for {?BeginDate} and {?EndDate}

2 - Create your record selection formula based on those two parameters:

  {Orders.Order Date} >= {?BeginDate}
  AND
  {Orders.Order Date} <= {?EndDate}

3 - Create a text object in the report header as follows:  "End date parameter engtry was earlier than Begin date parameter - please retry.

4 - Conditionally suppress the text object based on:  {?EndDate} > {?BeginDate}

Note:  Sample report attached

Keywords

parameter;date parameter;date/time parameter;date range;parameter entry error message;valid parameter , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

Crystal Reports 2008 V0 ; SAP Crystal Reports XI ; SAP Crystal Reports XI R2

Attachments

SampleReport.rpt