Kbase P130030: 3 digits years dates can be stored despites the format is 4 digits years
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  4/4/2008 |
|
Status: Unverified
FACT(s) (Environment):
All Supported Operating Systems
Progress 9.x
OpenEdge 10.x
SYMPTOM(s):
3 digits years dates can be stored in the database
The FORMAT of the field is 99/99/9999
Date value has 3 digits year (example: 01/01/100)
ODBC client cannot retrieved properly the date
MS EXCEL displays 00/01/1900
CAUSE:
This is expected behavior. The FORMAT of the FILL-IN or field, is a display format, and not a storage format unlike SQL.
Therefore, if a 3 digits year date is entered in the FILL-IN, it will be stored with 3 digits but displayed with 4 digits.
FIX:
The solution is to prevent users to enter 3 digits years from the application.
There are 2 ways:
1. Initialize the date field and disable auto-zap.
DEFINE VARIABLE d AS DATE FORMAT "99/99/9999" INIT TODAY.
UPDATE d DISABLE-AUTO-ZAP a AS CHAR WITH FRAME f.
or
2. Add a date validation in the LEAVE trigger of the FILL_IN