I need to write a case statement for checking valid date data type for column in my table.
table is having BUS_DT date format 'yy/mm/dd' as column.
How can I check in case statement if date value in table is valid date then return BUS_DT value else ''.
Please advice me.
Which TD version are you on?
You can use the UDF ISDATE in the CASE statement to check whether the string provided is a valid date or not agsinst 20 different date formats...
The first thing is if the column definition is BUS_DT date format 'yy/mm/dd' then it will not allow invalid date during insertion.
Invalid values are possible in case the column is defined as Character.
Can you please tell your concern about invalid date in this column? Or some sample data for this column?