Subject Re: [firebird-support] Re: Need SQL help for finding non-existant records
Author Ann W. Harrison
Clay Shannon wrote:
>
> I don't know what you mean by "moving everything referring to pchup from the
> WHERE clause to the LEFT JOIN clause." How is that done?
>
He meant to say 'the ON clause of the left join'

> select h.fullname, s.shiftdate, p.pchin, p.pchout, s.shift_begin,
> s.shift_end
> from scheduled_work s
> LEFT join pchup p on
( p.empno = s.empno and
(cast(p.pchin as date) = s.shiftdate) and
((cast(p.pchin as time) > s.shift_begin) or
(cast(p.pchout as time) < s.shift_end)))

> join empinfo_history h on h.empno = s.empno
> where > order by s.shiftdate


Regards,


Ann