I've had performance issues using the IN command (esp not in
) and try to use joins instead. See below:
FROM Lab1 o
JOIN Lab2 t ON t.Orderno = o.OrderNo
WHERE t.dt <= '10/4/2010' AND t.dt >= '10/4/2010'
The Lab2 table filter though where you specify the date... Wouldn't the expression be valid for any value of dt? The query looks for anything less than or equal to 10/4/2010 and anything greater than or equal to 10/4/2010. I would imagine in this case you would have the same result set even if you did not specify dt criteria in the where clause.