Subject | Re: [firebird-support] Re: Need SQL help for finding non-existant records |
---|---|
Author | Ann W. Harrison |
Post date | 2005-06-24T15:11:27Z |
Clay Shannon wrote:
(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)))
Ann
>He meant to say 'the ON clause of the left join'
> 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?
>
> select h.fullname, s.shiftdate, p.pchin, p.pchout, s.shift_begin,( p.empno = s.empno and
> s.shift_end
> from scheduled_work s
> LEFT join pchup p on
(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.empnoRegards,
> where > order by s.shiftdate
Ann