ACC2000: Date Expression for Filter Criteria in a Bound Form Does Not Always Filter Hijri or Gregorian Dates as Expected (231929)
The information in this article applies to:
This article was previously published under Q231929 Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
Under certain circumstances, the following behaviors may occur:
- Hijri dates entered in Filter criteria are interpreted as Gregorian dates.
- Short format Gregorian dates entered in Filter criteria are assumed to have mm/dd/yy format, regardless of Control Panel settings.
You may receive incorrect results if you enter Filter criteria without regard to these behaviors.
CAUSE
When you use the format #date# to specify a date value in a query, the date is always interpreted as a Gregorian value. In the example described in the "More Information" section later in this article, the date 2/4/18 is interpreted as 2/4/2018 instead of 2/4/1418 (Gregorian year 1997); this returns the wrong results when the filter example (in the "More Information" section) is run. Also, note that if the database calendar is set to Gregorian, you still get the wrong results if the date is entered in dd/mm/yy format.
RESOLUTION
Use the following workarounds:
- When you use the #date# format to specify a date criteria, enter the date value as a Gregorian value.
- When you use the #date# format to specify a date criteria, enter a Gregorian short date value in the mm/dd/yy format, regardless of the format in Regional Settings tool. To avoid ambiguity in date interpretation, enter dates in long format instead of short format.
- For maximum flexibility, use the CDATE("date") format to specify the date value in the Filter criteria. Both Gregorian and Hijri dates are recognized according to the Use Hijri Calendar check box setting (see the "More Information" section), and the short date format from the Control Panel setting is used. In this case, workarounds 1 and 2 are not be necessary.
Modification Type: | Major | Last Reviewed: | 6/28/2004 |
---|
Keywords: | kbBidi kbprb KB231929 |
---|
|