Re: query problem with Access database



On Feb 28, 9:58 am, David Segall <d...@xxxxxxxxxxxxxxx> wrote:
"HuskerGrad" <HuskerG...@xxxxxxxxx> wrote:
Hi,

I am writing a Java application that uses an Access database. I have
the following query that has mulitple joins and a sum on one of the
fields:

Select a.date, b.name, sum(c.score) as total
from (table1 as a,
inner join table2 as b on a.person_id = b.id)
inner join table3 as c on a.game_id = c.id
group by a.date, b.name

If I run the query in Access, it works fine, but from within the Java
code, I get the SQLException "You tried to execute a query that does
not include the specified expression 'DATE' as part of an aggregate
function."

Any help would be greatly appreciated.

DATE is a reserved word in SQL. Try changing the name of this column.- Hide quoted text -

- Show quoted text -

One of the thing you have to becareful is the syntax
ie the use of " and '
these make difference in your code
do first select and then you can do the other with the same pattern
Good luck

-sem

.



Relevant Pages

  • Re: correlated subquery in the crosstab
    ... FROM (tblStudent INNER JOIN (tblClass INNER JOIN ... values from the outer query and I have made an alias for it. ... I have students, courses, exam groups containing exams of courses, ... that the crosstab query in access has much more capablities than ...
    (microsoft.public.access.queries)
  • Re: correlated subquery in the crosstab
    ... I solved my problem using stored queries to act as subqueries. ... FROM (tblStudent INNER JOIN (tblClass INNER JOIN ... values from the outer query and I have made an alias for it. ... that the crosstab query in access has much more capablities than ...
    (microsoft.public.access.queries)
  • Re: query
    ... If you are able to limit the date range then add that to your query with a WHERE clause and index the date field. ... FROM (Table1 as T1 ... INNER JOIN Table2 as T2 ... John Spencer wrote: ...
    (microsoft.public.access.queries)
  • Re: Distinct and Group By
    ... FROM Table1 T1 INNER JOIN ... Based on the data in the tables, this query generates the following result: ... I want unique UserID's and the lowest MiscID for each row. ...
    (microsoft.public.sqlserver.programming)
  • Re: correlated subquery in the crosstab
    ... The first query ... TRANSFORM FirstAS FirstOfscore ... FROM tblStudent INNER JOIN (((tblEduYear INNER JOIN tblExamGrp ON ... that the crosstab query in access has much more capablities than ...
    (microsoft.public.access.queries)