Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 sql expression field error

Author  Topic 

fbcarl
Starting Member

3 Posts

Posted - 2008-05-16 : 06:24:27
hello, can anyone help me with my problem with crystal report
i am using access 2000 dtabase and trying to make an sql statment with a distinct select from the database and including the sum of specific records in the database but iam getting an error " you are trying to execute a querry that is not part on an aggregate exprression" this is when i make from sql expression fields... tnx

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2008-05-16 : 07:55:09
What does the query look like?

--
Lumbago
Go to Top of Page

fbcarl
Starting Member

3 Posts

Posted - 2008-05-17 : 04:04:25
quote:
Originally posted by Lumbago

What does the query look like?

--
Lumbago



here is table i want to view on crystal report 8.5

FIELD 1 : FIELD: 2
CASH IN BANK 1000.00
LOANS PAYABLE 1000.00
CASH IN BANK 500.00
LOANS RECEIVABLE 500.00
........ETC ...ETC

i want to look it like this on the report

CASH IN BANK 1500
LOANS PAYABLE 1000
LOANS RECEIVABLE 500
.... AND SO ON...........

i select "Select Distinct" on the database menu and i get the distinct name of field 1 but when i make a sql field expression for the sum of the like for ex cash in bank i got error that the field 1 is not part of an aggregate expression is there any other way to do it. thanks....
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2008-05-19 : 02:02:08
SELECT Field1, SUM(Field2) AS SumField2
FROM TABLE
GROUP BY Field1

--
Lumbago
Go to Top of Page
   

- Advertisement -