Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

query problem with Access database

Thread view: 
HuskerGrad - 28 Feb 2007 14:33 GMT
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.

Jeff
David Segall - 28 Feb 2007 14:57 GMT
>Hi,
>
[quoted text clipped - 16 lines]
>
>Jeff
David Segall - 28 Feb 2007 14:58 GMT
>Hi,
>
[quoted text clipped - 14 lines]
>
>Any help would be greatly appreciated.
DATE is a reserved word in SQL. Try changing the name of this column.
Sem - 28 Feb 2007 15:13 GMT
> >Hi,
>
[quoted text clipped - 18 lines]
>
> - 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
HuskerGrad - 28 Feb 2007 15:18 GMT
> DATE is a reserved word in SQL. Try changing the name of this column.

I tried that, no luck.  I still get the same error.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.