On Mon, 03 Mar 2003 12:04:37 -0800, you wrote:

>I have a database that holds a start date and an end date and I have a form
>with a start date and an end date. The report would be to get everything in
>the database's date ranges that overlap the form's date range. I am having
>trouble figuring out how to get this to work, any help is appreciated.

[if I understand you correctly]

you have 4 variables

db_start
db_end
form_start
form_end

and you want to select all rows where the range (db_start to db_end)
overlaps in any way with (form_start to form_end)?

You need two conditions, joined with an OR

(form_start => db_start AND form_start <= db_end)
OR
(form_end => db_start AND form_end <= db_end)

(BTW, this is an SQL question, not a PHP one.)


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to