There is a column as DATE_OF_BIRTH of datatype varchar(10). The expected data format is YYYY/MM/DD. However there are some NULL values and some values only contain the year(YYYY) value alone. The output is to calculate the AGE with this data. If the AGE is greater than 18 then the value must be retained, else it should be populated as NULL There is a sample data that is mentioned below
Input
DATE_OF_BIRTH |
---|
2000/01/01 |
2019/03/04 |
1999/02/18 |
? |
1998 |
? |
? |
Output
DATE_OF_BIRTH |
---|
2000/01/01 |
? |
1999/02/18 |
? |
1998 |
? |
? |
Any help is appreciated. Thanks