Re: Can anyone do this ?

2001-02-15 Thread Jack Rhinesmith
o: "Bob Hall" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, February 14, 2001 4:46 PM Subject: Re: Can anyone do this ? > Hi Bob/ All, > > I cannot get the creation of the TEMPORARY Table to > work: > The select sta

Re: Can anyone do this ?

2001-02-15 Thread Bob Hall
Sir, 99% of the time, if someone can't create a TEMPORARY table, it means that they're using an earlier version of MySQL that doesn't support temp tables. The best thing to do is to update to the most recent version. If you can't update (e.g. if MySQL is being maintained by a web hosting servi

Re: Can anyone do this ?

2001-02-14 Thread Web Depressed
Hi Bob/ All, I cannot get the creation of the TEMPORARY Table to work: The select statement works fine: mysql> SELECT table1_id, Count(date) as c FROM Table2, Table1 -> WHERE Table2.date BETWEEN "2001-02-02" AND "2001-02-06" -> AND Table2.table1_id=Table1.id -> GROUP BY Table1.id HAVI

Re: Can anyone do this ?

2001-02-07 Thread Rob McMillin
Web Depressed wrote: > Hi Bob, > Many thanks for that. I was hoping (through absolute > naiveity) not to have to go and calculate the number > of days with the specified range. Unless, of course > I could have mysql do this for me. Question: why are you using reserved words for your column na

Re: Can anyone do this ?

2001-02-06 Thread Bob Hall
Sir, in the first SQL statement, you could use HAVING cnt = (DAYOFYEAR(min)-DAYOFYEAR(max)) + 1 Of course, this won't work if min is in the year 2000 and max is in 2001. I think this will actually be easier to work out in your client, assuming you have a programmable client. >Hi Bob, >Many

RE: Can anyone do this ?

2001-02-05 Thread Jeff Sorenson
Ooops, I forgot to notice that you required consequetive days. This query works for me: select T1.*, T2.*, count(T2.id) as c, concat(T2.id,T2.d) as x from table1 as T1, table2 as T2, table 2 as T3 where T1.id=T2.id and T2.id=T3.id and T2.d>='2001-02-04' and T2.d<='2001-02-06' and T3.d>='2001-0

Re: Can anyone do this ?

2001-02-05 Thread Rus
001-02-06")-DAYOFYEAR("2001-02-04")) GROUP BY t1.id; - Original Message - From: Web Depressed <[EMAIL PROTECTED]> To: Rus <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, February 05, 2001 12:39 PM Subject: Re: Can anyone do this ? > Hi Rus, > I&#x

Re: Can anyone do this ?

2001-02-05 Thread Web Depressed
Hi Bob, Many thanks for that. I was hoping (through absolute naiveity) not to have to go and calculate the number of days with the specified range. Unless, of course I could have mysql do this for me. Can anyone tell me how I could generate such a list. (ie something like: SELECT BETWEEN "20

Re: Can anyone do this ?

2001-02-05 Thread Web Depressed
Hi Rus, I'm not sure I follow, but the DATE column represents the dates at which I have a certain item in stock. ie (. for from 2001-02-04 -> 2001-02-06 I have Item1 in stock. However I only have Item2 in stock on 2001-02-04 AND 2001-02-06). A typical application would be a car hire company: wh

Re: Can anyone do this ?

2001-02-04 Thread Bob Hall
>Hi, >I've been trying for a while now and I can't figure >out how to do the following: > >In regular English, I wish to show all items for which >I have allocations greater than one for all days >encapsulated between the user input range. > >User Input: >--- >Date_from (ie. 2001-02-0

Re: Can anyone do this ?

2001-02-04 Thread Rus
Can you explain what difference between dates 2001-02-04 and 2001-02-06 for item2 and 2001-02-04 and 2001-02-06 for item1? - Original Message - From: Web Depressed <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, February 04, 2001 11:41 PM Subject: Can anyone do this ? > Hi,

RE: Can anyone do this ?

2001-02-04 Thread Jeff Sorenson
Try: select t1.*, t2* from table1 as t1, table2 as t2 where t2.date>='2001-02-04' and t2.date<='2001-02-06' and t1.id=t2.id and t2.no_of_items>=1 >>Here is where I'm at: >>mysql> SELECT t1.*, t2.* >> -> FROM Table1 t1, Table2 t2 >> -> WHERE t2.date BETWEEN "2001-02-04" AND >>"2001-02-06"