Consultor Eletrônico



Kbase P121517: Runtime error 85 is returned by the DATE function when passed an invalid date string
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   22/12/2008
Status: Verified

SYMPTOM(s):

Runtime error 85 is returned by the DATE function when passed an invalid date string

** Invalid date input. (85)

Converting CHARACTER to DATE datatype using DATE function

String value does not contain a valid date representation

FACT(s) (Environment):

OpenEdge 10.1B
OpenEdge 10.1C
All Supported Operating Systems

CHANGE:

Upgraded from earlier release to OpenEdge 10.1B03 or later

CAUSE:

This is expected behavior.

The fact that converting an invalid string to a date did not return any error in earlier Progress/OpenEdge version was a bug which has been fixed in OpenEdge 10.1B.
If the string is not a valid date, and it is either '?' or a blank string, the unknown value ('?') is returned, otherwise an error is returned.
In 10.1B, the behavior of the DATE function is now consistent with the other conversion functions, such as INT and LOGICAL.

FIX:

Use the NO-ERROR option with the assign statement to both suppress the run time error and obtain the unknown value as documented and as desired.