
January 20th, 2004, 09:33 AM
|
|
Registered User
|
|
Join Date: Dec 2003
Posts: 12
Time spent in forums: 4 m 7 sec
Reputation Power: 0
|
|
|
I submitted a post on the ACCESS forum titled Multi-Level Group By error and this is the reply I got back:
This may be resolved by creating a chain of queries eg. several queries built on each other. So try to not use a sub query but create a so-called 'pre-query' and create an other query working on that pre-query.
__________________
BRegs,
TBÁrpi
Here is my original SQL query:
SELECT Employee_Info.Emp_ID, Employee_Info.Emp_FName, Employee_Info.Emp_MI, Employee_Info.Emp_LName, Employee_Pay_Info.Emp_Pay_Amt, Employee_Pay_Info.Emp_Pay_DT, Employee_Info.Emp_Init_Sal+(SELECT sum(Employee_Pay_Info.emp_pay_amt) FROM Employee_Pay_Info where employee_pay_info.emp_id = Employee_info.emp_id AND Employee_Pay_Info.Emp_Pay_Type_ID=1) AS Salary
FROM Employee_Info INNER JOIN Employee_Pay_Info ON Employee_Info.Emp_ID=Employee_Pay_Info.Emp_ID
WHERE Employee_Pay_Info.Emp_Pay_Type_ID=1;
The [Salary] is causing the report to generate the error and I havent' found a way around it. I need that value for the report. If you can help me I'd appreciate it very much.
|