Hola Gracias por responder, hize loa cambios pero no tengo resultados, me sigue botando error :
Código Delphi
[-]
select datatrab.codtra
from datatrab
inner join registro on datatrab.codtra=registro.codtra
where datatrab.codtra not in
(select registro.codtra from registro where registro.fecha='2006-07-04' and left(registro.codtra,1)='O')
Este es el error :
Código Delphi
[-]
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select registro.codtra from registro where registro.fecha='2006'