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 into the selection of record 2?

-----Original Message-----
From: John Rosendahl [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 12:53 PM
To: [EMAIL PROTECTED]
Subject: Exclusion Query help


I am trying to run a query I have a table Records
----------------------------
|Record_ID                |
|Phase_ID                  |
|Record_Date            |
----------------------------

I need to find the records that have a record date between date1 and 
date 2 but exclude the records with a matching Phase_ID that opccured 
between date3 and date 4

so if I had the following table
Record_ID    Phase_ID    Record_Date
1                       1                1/01/01
2                        3                14/01/01
3                        1                14/01/01


I would want want the query to return only Record number 2
(Given that 1/01/01 is between date 3 & 4 and 14/01/01 is between date 1 
& 2)

Does anyone know how to do this?

mySQL, SQL



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to