SELECT hota17.pdat as pdat, 
       hota17.p03 as p03, 
       hota17.p05 as p05, 
       hota18.p02 as a18p02, 
       ifnull(a14.p01, '') as a14p01
FROM hota04, hota18, hota17
LEFT JOIN a14 ON a14.nr01=hota17.p06
WHERE hota17.pnr01=hota04.nr01
   && hota17.p02=hota18.p01
   && hota17.p05<>0
   && hota18.p08=1
/*   && hota17.pdat<='{odbcdtos(np01)}'
*/
   && hota04.nr01={my_hotar04[1]}
ORDER BY hota17.pdat;
