Hi Cetin
DOH!
Yes the old order or evaluation of operators has bitten me. I should have known better and realised.
Thanks. I did that but unfortunately I'm still getting the same spurious answer.
Terry
>Terry,
>I'd start by putting parentheses around "or" "and" blocks of where clause. As I interpret it now:
>
>where ET.date BETWEEN ldStartCurr and ldEndCurr ;
> OR ( ET.date BETWEEN ldStartPrev and ldEndPrev ;
> AND NOT EXISTS ... )
>
>Probably you meant:
>
>where ( ET.date BETWEEN ldStartCurr and ldEndCurr ;
> OR ET.date BETWEEN ldStartPrev and ldEndPrev ) ;
> AND NOT EXISTS ...
>
>Cetin
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.