Re: SELECT question - query for records over a series of dates

2005-08-17 Thread Dan Tappin
I think you might be one to something here... is there such a thing as a while loop in MySQL? i.e. can I fill a table with data via a MySQL query? I guess I could do it via PHP... I could create a temp table with one column of dates for the range I am looking for and then LEFT JOIN my

Re: SELECT question - query for records over a series of dates

2005-08-17 Thread Michael Stassen
Dan Tappin wrote: I think you might be one to something here... is there such a thing as a while loop in MySQL? i.e. can I fill a table with data via a MySQL query? I guess I could do it via PHP... I could create a temp table with one column of dates for the range I am looking for and

SELECT question - query for records over a series of dates

2005-08-16 Thread Dan Tappin
I have a table full of data... a log of sorts. Each row has a timestamp. I want to generate some reports based on this data. For example I want a COUNT(*) of the rows for each day for the past week, 30 days, 12 months etc. I have no problem generating the query but I am stuck on a

Re: SELECT question - query for records over a series of dates

2005-08-16 Thread Daniel Kasak
Dan Tappin wrote: I have a table full of data... a log of sorts. Each row has a timestamp. I want to generate some reports based on this data. For example I want a COUNT(*) of the rows for each day for the past week, 30 days, 12 months etc. I have no problem generating the query but I

Re: SELECT question - query for records over a series of dates

2005-08-16 Thread Michael Stassen
Dan Tappin wrote: I have a table full of data... a log of sorts. Each row has a timestamp. I want to generate some reports based on this data. For example I want a COUNT(*) of the rows for each day for the past week, 30 days, 12 months etc. I have no problem generating the query but I am

Re: Question - Query

2003-01-27 Thread Terence Ng
://groups.google.com/groups?hl=enlr=ie=UTF-8oe=UTF-8; group=mailing.database.mysqlmailing.database.mysql Date: 2003-01-08 01:16:04 PST Subject: Question - Query Perhaps you didn't see it:). Use a CASE statement to conditionally SUM the amount_us values, ie. SUM only when

Re: Question - Query

2003-01-22 Thread Terence Ng
this to: Newsgroups: A HREF=http://groups.google.com/groups?hl=enlr=ie=UTF-8oe=UTF-8group=mailing.database.mysql;mailing.database.mysql/A Date: 2003-01-08 01:16:04 PST Subject: Question - Query Perhaps you didn't see it:). Use a CASE statement to conditionally SUM the amount_us values, ie

Question - Query

2003-01-08 Thread Terence Ng
How do I correct this SQL code: 2 tables there, lcopen: id, bank, unit_price_us, order_cbm lcreceive: id, amount_us, due_date #this condition :lcreceive.due_date current_date #only affect to : SUM(lcreceive.amount_us) #and NOT : #SUM(lcopen.unit_price_us*lcopen.order_cbm) * 7.8 AS open

Re: Question - Query

2003-01-08 Thread gerald_clark
FROM must precede WHERE. Terence Ng wrote: How do I correct this SQL code: 2 tables there, lcopen: id, bank, unit_price_us, order_cbm lcreceive: id, amount_us, due_date #this condition :lcreceive.due_date current_date #only affect to : SUM(lcreceive.amount_us) #and NOT :

RE: Newbie Question - Query works in access but not MySQL

2002-11-12 Thread Alan McDonald
ignore the obsolete in the main select when it's returned since it will all be the same value... put it first. Alan -Original Message- From: Ed Reed [mailto:ereed;nearfield.com] Sent: Tuesday, 12 November 2002 18:54 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Newbie Question

RE: Newbie Question - Query works in access but not MySQL

2002-11-12 Thread Mark Armer
BY Products.PartNumber; Mark -Original Message- From: Alan McDonald [mailto:alan;meta.com.au] Sent: Tuesday, November 12, 2002 02:05 To: Ed Reed; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Newbie Question - Query works in access but not MySQL Do you have a space between PartNumber and Like

RE: Newbie Question - Query works in access but not MySQL

2002-11-12 Thread Ed Reed
Question - Query works in access but not MySQL Do you have a space between PartNumber and Like? Also there's not need to ORDER BY - the GROUP BY does that anyway (I know that's the case elsewhere) and finally, I have to guess that it's objecting to Obsolete not being in the main select.. have you

Newbie Question - Query works in access but not MySQL

2002-11-11 Thread Ed Reed
This is my first post. I hope it works and please excuse me if I screw up. I have an MS Access database I'm trying to convert to MySQL v4.0.3 for Netware. I use a VB frontend to talk to my .mdb file. So far I've gotten all my data into MySQL using the MyAccess tool I bought. In my VB frontend

Re: Newbie Question - Query works in access but not MySQL

2002-11-11 Thread Ed Reed
I came up with a translation to the first query, which had the two sub-selects, and it now seems to work. I've yet to come up with a solution to the second query, which had the Group By clause. I'd still like to hear some ideas. - Ed Ed Reed [EMAIL PROTECTED] 11/11/2002 8:03:03 PM This is my

Re: Newbie Question - Query works in access but not MySQL

2002-11-11 Thread Ed Reed
UPDATE: Still trying to solve this and I think I have something that's a little easier to understand. If I run the following query against MySQL it returns Unknown column 'Obsolete' in 'having clause'. If I run the query using MSAccess as a frontend to MySQL the query runs correctly (it returns a