VALID_DATE() function sees empty string as valid

Document ID : KB000087570
Last Modified Date : 14/04/2018
Show Technical Document Details
Error Message :

When using the VALID_DATE() command, the command would interpet blank values as a valid date.


For an example of this behavior, from within a script object:

:set &var# = "" 
:set &ret# = valid_date(&var#) 
:print &ret# 

The following code should set &ret# to "N", because "" is not a valid date. However, &ret# is set to "Y".


Cause type:
Root Cause: An empty parameter results in a valid date.
This field was added on 30/03/2017. This article has not been updated yet. Refer to the "Description" or "Workaround" sections for solution information.

Fix Status: Released

Fix Version(s):
Automation.Engine 12.0.1 - Available
Automation.Engine 11.2.4 - Available
Additional Information:
Workaround :
You can define the expected date format instead and this works as designed: :set &var# = "" :set &ret# = valid_date("YYMMDD:&var#") :print &ret#