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

Reply via email to