if you have a table with a date field, you can write a query that will look
something like this:

// assuming these dates
$start_date = '2001-02-05';
$end_date = '2001-07-05';

// sql query
SELECT * FROM events_table WHERE date_field >= '$start_date' AND date_field
<= '$end_date';

this would result in all events starting Feb 02, 20001 and ending July 05,
2001

depending on your requirements you can use the following comparison
operators:

for $start_date:
        =       equal to
        >=      Greater than or equal to
        >       Greater than

for $end_date:
        =       equal to
        <=      less than or equal to
        <       less than

Hope this helps.


-----Original Message-----
From: Mike Baerwolf [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 5:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Date Ranges


Hi,

I'm working on a event calendar and some events span more than one day. I
would like to store a date range like 2001-02-05 thru 2001-07-05 so when I
do a query for the current day the event would appear for all the days in
the range.  I hoping someone can point me to some documentation or tutorials
on this.

Thanks in advance,
Mike


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to