Larry

This is some good info.. I didn't know about the failing on NULL for
the IN clause. Hadn't never had to use it till now. I'll try your
suggestions here in a bit. I'm cookin some supper. My wife had her
gall bladder removed yesterday and I am only workin on this to fill
in some time here and there. BTW, she is doing pretty good, it's me
that's a shamble over all this..

Thanks
Jim

At 01:26 PM 9/21/2004, you wrote:
Try changing:

> FROM [orders] AS order1 +
> inner JOIN [customers] ON order1.custid=customers.custid +
> WHERE order1.dateordered BETWEEN strglblbegdate  AND strglblenddate +

To:

FROM [orders] AS order1 +
inner JOIN [customers] ON order1.custid=customers.custid +
WHERE +

>> order1.orderID NOT IN (SELECT OrderID FROM tblSchedule) AND +

order1.dateordered BETWEEN strglblbegdate  AND strglblenddate +

(the new code is on the >> line).  You don't need to add tblSchedule to the
FROM clause of main SELECT statement, and do not put it in the middle of the
INNER JOIN syntax.

You should also know the following about MS Access:

1. It is exceedingly slow with the IN statement if a large number of values are
returned.


2. It will fail if the IN select returns a NULL as one of its values, so you
should always explicitly protect against that possibility.

--
Larry

--
Larry



Reply via email to