DATEFMT - connect_cdc_sqdata - Latest

Connect CDC (SQData) Apply engine

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect CDC (SQData)
Version
Latest
Language
English
Product name
Connect CDC (SQData)
Title
Connect CDC (SQData) Apply engine
Copyright
2024
First publish date
2000
ft:lastEdition
2024-07-30
ft:lastPublication
2024-07-30T20:19:56.898694

The DATEFMT formats/reformats a date value. This function also converts a two (2) digit year to a four (4) digit year using a window value of 50. If the source data contains a two (2) digit year, it will automatically converted to a four (4) digit year. This is done by adding 2000 if the source year is less than 50 and adding 1900 if the source year is greater than or equal to 50.

Category

Date / Time

Syntax
DATEFMT(source_date, source_format, target_format)

Parameters and Descriptions

Parameter Description
source_date

This parameter specifies a source date in the format specified in the parameter source_format.

source_format

This parameter specifies the format of the source date. This parameter is expressed using three (3) mandatory characters (Y, M, D) as follows: YMD - year, month, day DMY - day, month, year MDY - month, day, year An optional separator character can be specified after the mandatory characters (i.e. YMD/, YMD-. The source_format parameter must be enclosed in single quotes (').

target_date

This is the desired format of the target date that will be returned by the DATEFMT function. This parameter is expressed using three (3) mandatory characters (Y, M, D) as follows: YMD - year, month, day DMY - day, month, year MDY - month, day, year An optional separator character can be specified after the mandatory characters (i.e. YMD/, YMD-. The target_format parameter must be enclosed in single quotes (').

Example

Reformat the date value of 01/05/2003 into the format of 2004-01-05 and map the result to target field REFMT_DATE.
REFMT_DATE = DATEFMT('01/05/2003', 'DMY/', 'YMD-')