Re: Exclusion Query

2006-06-22 Thread Peter Brawley
>SELECT * >FROM Customers C >LEFT OUTER JOIN Orders O >ON C.CustomerID = O.CustomerID >WHERE OrderID IS NULL OR C.CustomerID IS NULL >ORDER BY OrderID Correct except lose "OR c.customerID IS NULL", it makes no sense. PB - Daniel McQuay wrote: had a problem like this in class today

Re: Exclusion Query

2006-06-22 Thread Karl Larsen
Jeremy Rottman wrote: I am working on an MLS Exclusion report. In on table1 I have all the information we collect for our files. Each day I download an update our mls table (table2). what I am trying to do is find all the records in table2 that are not in table1. This is the query that I am

Re: Exclusion Query

2006-06-22 Thread Daniel McQuay
had a problem like this in class today and we solved it with a LEFT OUTER JOIN. we had to find customers who did not place an order or orders with no customers. this was in MSSQL but it may be something to work off of. USE Northwind SELECT * FROM Customers C LEFT OUTER JOIN Orders O ON C.Customer

RE: Exclusion Query help

2002-02-12 Thread Rick Emery
If I understood you correctly you are comparing Record_ID to Phase_ID try this: SELECT rx.* FROM records rr LEFT JOIN records rx ON rr.Record_ID=rx.Phase_ID WHERE rr.Record_Date>@date1 && rr.Record_Date<@date2 && NOT (rx.Record_Date>@date3 && rx.Record<@date4); This assumes that @date1, @d

RE: Exclusion Query help

2002-02-12 Thread Rick Emery
If I understood you correctly you are comparing Record_ID to Phase_ID try this: SELECT rx.* FROM records rr LEFT JOIN records rx ON rr.Record_ID=rx.Phase_ID WHERE rr.Record_Date>@date1 && rr.Record_Date<@date2 && NOT (rx.Record_Date>@date3 && rx.Record<@date4); This assumes that @date1, @d

RE: Exclusion Query help

2002-02-12 Thread Rick Emery
If I understood you correctly you are comparing Record_ID to Phase_ID try this: SELECT rx.* FROM records rr LEFT JOIN records rx ON rr.Record_ID=rx.Phase_ID WHERE rr.Record_Date>@date1 && rr.Record_Date<@date2 && NOT (rx.Record_Date>@date3 && rx.Record<@date4); This assumes that @date1, @d

RE: Exclusion Query help

2002-02-08 Thread Rick Emery
I'm trying to figure out the bloody hell you're looking for. What is date3? Where does it come from? I think I speak for most folks here when I say... What is date4? Where does it come from? What is date4? Where does it come from? Why is record 2 good, but not record 3? How does Phase enter i