Dein Select mit dem Fehler:
and substr(F4, 1, 7)

Dein Kontroll-Select:
and substr(F4, 1, 1)

Das sind 2 unterschiedliche substrings