Re: Selecting rows by DATE ranges

2007-06-25 Thread Jørn Dahl-Stamnes
On Monday 25 June 2007 10:32, Mogens Melander wrote: > Looks like you have datetime fields makeing > "2007-01-01 00:00:01" > "2007-01-01". Or use SELECT ... WHERE CONVERT(date,DATE)>"2007-01-01"... if 'date' is a DATETIME fiel

Re: Selecting rows by DATE ranges

2007-06-25 Thread Mogens Melander
Looks like you have datetime fields makeing "2007-01-01 00:00:01" > "2007-01-01". Also using BETWEEN on date-ranges might help. On Sun, June 24, 2007 02:13, Miguel Cardenas wrote: > Hello list > > I found a little problem with an application am developing, in

Re: Selecting rows by DATE ranges

2007-06-23 Thread Pintér Tibor
date(), date_format() t Miguel Cardenas írta: Hello list I found a little problem with an application am developing, in particular creating reports by DATE ranges. Examples: select ... where date>"2007-01-01"; returns all records where date is greater (and equal inclusive)

Selecting rows by DATE ranges

2007-06-23 Thread Miguel Cardenas
Hello list I found a little problem with an application am developing, in particular creating reports by DATE ranges. Examples: select ... where date>"2007-01-01"; returns all records where date is greater (and equal inclusive) to 2007-01-01 select ... where date>="200

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

Date Ranges

2005-09-06 Thread Shaun
Hi, Given two dates, can Mysql calculate and return all the dates that occur between them? Thanks for your advice. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

RE: Using date ranges on a composite key degrades performance

2004-06-22 Thread SGreen
om> cc: <[EMAIL PROTECTED]> Fax to:

RE: Using date ranges on a composite key degrades performance

2004-06-22 Thread David Perron
6-15' AND factable.Date < '2004-06-22' -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 22, 2004 3:16 PM To: David Perron Cc: [EMAIL PROTECTED] Subject: Re: Using date ranges on a composite key degrades performance Are you usin

Re: Using date ranges on a composite key degrades performance

2004-06-22 Thread SGreen
om> cc: Fax to: 06/22/2004 02:46 Subject: Using date ranges on a composite key degrades performan

Using date ranges on a composite key degrades performance

2004-06-22 Thread David Perron
Im finding that when I execute a query joining to a large fact table (~450 million rows) using a composite key of INT(11) & DATE for a single Date i.e. AND dimension.id = factable.id AND factable.Date = '2004-06-22' the query returns exceptionally fast. However, when I change this to a range, i

Re: query date ranges

2004-03-07 Thread Michael Stassen
Kevin Waterson wrote: I have been trying this is several ways, currently I have a mess MySQL 4.1.1 PHP as the interface I have a table of with a date range called seasons. in it I have two date ranges and an amount to be charged for each day in the range 2004-01-01 00:00:00 2004-06-01 00:00

Re: query date ranges - step 2

2004-03-06 Thread Kevin Waterson
This one time, at band camp, Kevin Waterson <[EMAIL PROTECTED]> wrote: > seasonDateFrom seasonDateTo seasonRateWeekly > 2004-06-02 00:00:002004-10-31 00:00:00 42.86 > 2004-01-01 00:00:002004-06-01 00:00:00 34.29 > > When I take a booking I have yet another ra

query date ranges

2004-03-05 Thread Kevin Waterson
I have been trying this is several ways, currently I have a mess MySQL 4.1.1 PHP as the interface I have a table of with a date range called seasons. in it I have two date ranges and an amount to be charged for each day in the range 2004-01-01 00:00:00 2004-06-01 00:00:0044 2004-06-02

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

date ranges

2003-04-02 Thread Sarah Heffron
How would I do this: 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. Thanks, Sara