I have this function with only returns incorrect data but I am getting this error message

"function returned without value" when I run my query.

***function***

```
CREATE OR REPLACE FUNCTION date_chk(p_value VARCHAR2, p_format VARCHAR2)
RETURN NUMBER
AS
  v_val1 NUMBER(10);
  v_date DATE;
BEGIN
  v_date := TO_DATE(p_value,p_format);
  RETURN 1;
EXCEPTION
  WHEN OTHERS THEN
    IF SQLCODE = -01858 THEN
      RETURN 0;
    END IF;
END;

```

**Query**

```
SELECT sid,
       sid,
       sentry,
       daytime
FROM test_table

```

WHERE date\_chk(daytime,'HH24:MI') = 0;

**Edited**

For example if daytime had something like `09:99` it will come up with this error message but if it was `abshaasj` it will return those value. I am trying to return both numbers and letters if any of them is found in any of my records. I have 10345 records and a lot of them as the return time format.