How to check an invalid date in Teradata

Database
Enthusiast

How to check an invalid date in Teradata

I am a newbie in Teradata. I need to check a date column has valid date in case statement. This column is in "YYYY-MM-DD" format. If this field is invalid need to use '1900-01-01' as default. Can anyone please guide me on this?

2 REPLIES
Enthusiast

Re: How to check an invalid date in Teradata

Hi Sinara,

an invalid date occurs when attempting to insert an erroneous date value (character chain or number) in a DATE DATATYPE column. You should consider the DATATYPE and the FORMAT.

have a look at the docs (http://www.info.teradata.com/HTMLPubs/DB_TTU_14_00/index.html#page/General_Reference/B035_1096_111A/...).

Pierre

Junior Supporter

Re: How to check an invalid date in Teradata

Hi.

This is usually done with an OUTER JOIN to SYS_CALENDAR.CALENDAR.

HTH.

Cheers.

Carlos.