RE: Date Ranges

2005-09-07 Thread Mark Leith
---snip-- > Given any two dates, MySQL can tell if a third date is within > that range. > That's easy. > > To actually return a list of all dates between any arbitrary > pair of dates requires some form of loop (v5.0+) or a lookup > into a table populated with all possible dates (any version

Re: Date Ranges

2005-09-06 Thread SGreen
"Shaun" <[EMAIL PROTECTED]> wrote on 09/06/2005 03:47:25 PM: > Hi, > > Given two dates, can Mysql calculate and return all the dates that occur > between them? > > Thanks for your advice. > > > Given any two dates, MySQL can tell if a third date is within that range. That's easy. To act

Re: Date Ranges

2005-09-06 Thread Paul DuBois
At 20:47 +0100 9/6/05, Shaun wrote: Hi, Given two dates, can Mysql calculate and return all the dates that occur between them? No. Given two dates, MySQL can determine which of a set of already-existing dates stored in a table occur between them and return those. -- Paul DuBois, MySQL Docume

Re: date ranges

2003-04-03 Thread Bruce Feist
Bruce Feist wrote: Instead, if the four dates are s1, e1, s2, and e2 (s=start, e=end), we want: s1 <= e2 /* first range can't start after second range ends */ AND s2 <= e1 /* second range can't start after first range ends */ Bruce Feist also wrote: Your original suggestion works if

Re: date ranges

2003-04-03 Thread Bruce Feist
Matt Gostick wrote: Sarah Heffron wrote: I have a date range (start date and end date) supplied by the user and I also have information in a table that has start dates and end dates. I want to select everything in the table whose date range overlaps in any way with the date range given by the

Re: date ranges

2003-04-03 Thread Matt Gostick
> >>I have a date range (start date and end date) supplied by the user > >>and I also have information in a table that has start dates and > >>end dates. I want to select everything in the table whose date range > >>overlaps in any way with the date range given by the user. > >Well... if you

Re: date ranges

2003-04-02 Thread Bruce Feist
Matt Gostick wrote: Well... if you were given a start date of 2003-01-01 and end date of 2003-01-31... select * from table_name where start_date between "2003-01-01" and "2003-01-31" or end_date between "2003-01-01" and "2003-01-31" No? No. Example: start_date = "2002-01-01" and end_dat

Re: date ranges

2003-04-02 Thread Matt Gostick
Well... if you were given a start date of 2003-01-01 and end date of 2003-01-31... select * from table_name where start_date between "2003-01-01" and "2003-01-31" or end_date between "2003-01-01" and "2003-01-31" No? Matt. On Wed, 2003-04-02 at 16:32, Sarah Heffron wrote: > How would