Using SUM and GROUP BY
- From: "Ben" <bs2k1@xxxxxxxxxx>
- Date: 27 Apr 2006 07:06:29 -0700
Hi,
I have a table that stores hours, minutes, seconds and quantity. I can
find the quantity per hour by selecting hours and quantity and group by
hours with a sum for the quantity.
However if I want minutes I need to multiply the hours by 60
and add them to the minutes and then find the sum of the quantity. I
have tried the following sql statement.
SELECT Sum((hours*60)+minutes) AS mins, Sum(quantity) AS quant FROM
table1GROUP BY mins;
but keep getting this error
ERROR: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]
Too few parameters. Expected 1.
I've been playing around with it for a while, but get that message each
time.
Could someone point out where I am going wrong?
Thanks.
Ben.
.
- Follow-Ups:
- Re: Using SUM and GROUP BY
- From: Bjorn Abelli
- Re: Using SUM and GROUP BY
- From: Ben
- Re: Using SUM and GROUP BY
- Prev by Date: Re: UnsatisfiedLinkError
- Next by Date: Re: Using SUM and GROUP BY
- Previous by thread: Connect To MySql Using Port
- Next by thread: Re: Using SUM and GROUP BY
- Index(es):
Relevant Pages
|
|