Skip to main content
Skip table of contents

tryCastDate

You are looking at an older version of the documentation. The latest version is found here.

This procedure attempts to cast a string value to date and returns NULL instead of an error when this is impossible. If the original value is NULL, the returned value will also be NULL.

Parameters

ParameterDescription
originalValueOriginal value as a string
formatFormat of the date as a string
checkFormatRegexRegex format of the date as a string

Attributes

 Attribute

Type

Description

newValue

date

 Value cast to the new type

Example

SQL
CALL UTILS.tryCastDate(
    originalValue => '20181207',
    format => 'yyyy-MM-dd'
);; 

 Auto-parsing is available for the date string:

yyyy-MM-dd

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.