79507089

Date: 2025-03-13 16:40:41
Score: 1.5
Natty:
Report link

Since some_date is stored as VARCHAR(10), you should convert it into a DATE and filter out invalid values.

SELECT some_date FROM my_table WHERE TRY_CAST(some_date AS DATE) IS NULL;

Please store dates in DATE or DATETIME format instead of VARCHAR.

This will ensure the database enforces valid dates automatically.

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Arabi Nambi