Hele a co takhle tu druhou podmiku presunout do where ?

select * from A
join B on A.id = B.id
where SUBSTRING(A.datum,1,10)>=B.datum