I have these two days:

```
BEFORE_DATETIME: 2021-09-02 09:41:00
AFTER_DATETIME: 2021-09-09 09:41:00

```

I need to calculate the difference in these two days. So in this example: 7 days.However, in the BEFORE\_DATETIME, I have some values that are string (bad records). I keep getting an error when I use DATEDIFF function because of those records.

How can I calculate the difference in date and to ignore the bad records?