Search code examples
informaticainformatica-powercenter

Informatica Expression IS_DATE


This works:

TO_DATE(TO_CHAR('12'|| '-' || '12' || '-01'),'YYYY/MM/DD')

This does not work:

IS_DATE(TO_DATE(TO_CHAR('12'|| '-' || '12' || '-01'),'YYYY/MM/DD'))
IS_DATE(TO_DATE(TO_CHAR('12'|| '-' || '12' || '-01'),'YYYY/MM/DD'),'YYYY/MM/DD')

What exactly am I doing wrong? I have tried datatypes STRING and DATE/TIME


Solution

  • please try this

    IS_DATE(TO_CHAR('12'|| '-' || '12' || '-01'),'YYYY/MM/DD')

    Syntax: IS_DATE(input as char,format as char)

    IS_DATE returns 1 if the input is a valid date and 0 if the date is not valid.

    IS_DATE('02/01/2013', 'DD/MM/YYYY')-> returns 1 IS_DATE('02312013','MMDDYYYY')-> returns 0(as February 31st is not a valid date)