Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What'w wrong with my sql query?

Status
Not open for further replies.

avenuw

Programmer
Jun 21, 2007
45
US
Hello,

I am trying to runt the following query in access 2003, but I keep getting invalid procedure call. I checked everything and nothing seems wrong to me. Maybe someone can figure it out:


SELECT A.[a_name],A.[a_Num], SUM(A.JUL) AS JUL, SUM(A.AUG) AS AUG, SUM(A.SEP) AS SEP, SUM(A.OCT) AS OCT, SUM(A.NOV) AS NOV, Sum(A.Dec) AS [Dec], SUM(A.Jan) AS Jan, SUM(A.Feb) AS Feb, SUM(A.Mar) AS Mar, Sum(A.Apr) AS Apr, SUM(A.May) AS May, SUm(A.Jun) AS Jun, mid(A.[a_name],1,instr(A.[a_name],",")-1)
FROM actuals_tbl AS A
GROUP BY [a_name], [a_num]
HAVING A.[a_num] IN (9920331,9920332,9920333,9920334,9920335,9921331,9921332,9921333,9921334,9921335) AND
[a_name]<>"NO,PROVIDER" AND
mid(A.[a_name],1,instr(A.[a_name],",")-1) NOT IN
(SELECT DISTINCT mid([b_name],1,(instr([b_name],",")-1))
FROM estamites_tbl AS B)
ORDER BY [a_name],A.[a_num];


ALthough the query does return results, it does not complete and shows the invalid procedure call! What is wrong?

I should mention that a_name and B_name have format lastname,firstname initial - so I want to look at last name.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top