Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Aggregate function confusion

 
Brian Batson
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey! I am struggling with a SQL statement that I have embedded in my Java code. This is the first time I've ever had problems with a SQL statement that works fine in Microsoft Access but does not compile in Java. A screen shot of my SQL is attached. It's pretty long, that's for sure, but not too complex.

The error I get is: "You tried to execute a query that does not include the specified expression 'ID' as part of an aggregate function." This is confusing because, as you can see in the SQL statement, this is not an aggregate statement. There's no grouping of any kind.

Any ideas? Like I said, works just fine in Access, but generates the above error in Java.

Thank you for any help you can provide.

--Brian
sql_stmt.jpg
[Thumbnail for sql_stmt.jpg]
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On observing the query, I guess, MS Access is treating the JOIN operation as an Aggregation functionality.
 
Brian Batson
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Madhan Sundararajan Devaki wrote:On observing the query, I guess, MS Access is treating the JOIN operation as an Aggregation functionality.

Thanks for the reply, Madhan. What makes you suspect that one of the JOIN operations is being treated as an aggregation functionality?

For what it's worth, I was able to get around this by simply embedding a SELECT * from the query object itself but this obviously isn't ideal (selecting all records from a query feels quite redundant).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic