SQL Error

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Leo (anonymous_at_discussions.microsoft.com)
Date: 08/27/04


Date: Fri, 27 Aug 2004 11:35:14 -0700

Hi -

I have a problem with an SQL statement I am trying to
execute in VBA.
This SQL statement was generated by the 'Design Query'
tool in Access.

The error reads: "A RunSQL action requires an argument
consisting of an SQL statement"
Thus I think my SQL statement might have an operator (or
something) missing.

SELECT
R1B_PARTICIPANT_SCORE_BY_COMPETENCY_GROUP.COMPETENCY_GROUP
, Sum(IIf([% Grade]>=70,1,0)) AS Pass, Sum(IIf([% Grade]
<70,1,0)) AS Fail,
R1B_PARTICIPANT_SCORE_BY_COMPETENCY_GROUP.EMPLOYEE,
qry_Did_Not_Take.SumOfANSWERED, STUDENT_FIELDS.FIELD3 AS
Region, STUDENT_FIELDS.FIELD4 AS Country,
STUDENT_FIELDS.FIELD5 AS Division, STUDENT_FIELDS.FIELD2
AS Director, STUDENT_FIELDS.FIELD8 AS Function,
STUDENT_FIELDS.FIELD1 AS Name
FROM (R1B_PARTICIPANT_SCORE_BY_COMPETENCY_GROUP INNER
JOIN STUDENT_FIELDS ON
R1B_PARTICIPANT_SCORE_BY_COMPETENCY_GROUP.EMPLOYEE =
STUDENT_FIELDS.STUDENT_ID) LEFT JOIN qry_Did_Not_Take ON
STUDENT_FIELDS.STUDENT_ID = qry_Did_Not_Take.EMPLOYEE
GROUP BY
R1B_PARTICIPANT_SCORE_BY_COMPETENCY_GROUP.COMPETENCY_GROUP
, R1B_PARTICIPANT_SCORE_BY_COMPETENCY_GROUP.EMPLOYEE,
qry_Did_Not_Take.SumOfANSWERED, STUDENT_FIELDS.FIELD3,
STUDENT_FIELDS.FIELD4, STUDENT_FIELDS.FIELD5,
STUDENT_FIELDS.FIELD2, STUDENT_FIELDS.FIELD8,
STUDENT_FIELDS.FIELD1
HAVING
(((R1B_PARTICIPANT_SCORE_BY_COMPETENCY_GROUP.COMPETENCY_GR
OUP)<>"COMMODITY KNOWLEDGE/STRATEGY") AND
((qry_Did_Not_Take.SumOfANSWERED) Is Null) AND
((STUDENT_FIELDS.FIELD3)=[forms]![frm_Reports]!
[cmb_Pass_Fail_Region]) AND ((STUDENT_FIELDS.FIELD4)=
[forms]![frm_Reports]![cmb_Pass_Fail_Country]) AND
((STUDENT_FIELDS.FIELD5)=[forms]![frm_Reports]!
[cmb_Pass_Fail_Division]) AND ((STUDENT_FIELDS.FIELD2)=
[forms]![frm_Reports]![cmb_Pass_Fail_Director]) AND
((STUDENT_FIELDS.FIELD8)=[forms]![frm_Reports]!
[cmb_Pass_Fail_Function]) AND ((STUDENT_FIELDS.FIELD1)=
[forms]![frm_Reports]![cmb_Pass_Fail_Student]))
ORDER BY STUDENT_FIELDS.FIELD3, STUDENT_FIELDS.FIELD4,
STUDENT_FIELDS.FIELD5, STUDENT_FIELDS.FIELD2,
STUDENT_FIELDS.FIELD1;

Please Advise! Thanks!!



Relevant Pages

  • Re: tkprof interpreatation question
    ... library cache--Hard parse) ... Misses in library cache during execute (Misses while about to execute ... closes a cursor and then reopened a cursor with the same SQL statement ...
    (comp.databases.oracle.server)
  • Re: Optimizing inline view
    ... Mike C wrote: ... Can you verify that the SQL statement that ... I updated the statistics on this table and the thing ... If you are still having problems, execute the three ALTER SESSION ...
    (comp.databases.oracle.misc)
  • Re: newbie, getting cost plan
    ... I want to get the -real- cost and plan of an sql statement, ... assume that you can execute the SQL statement in question in SQL*Plus, ... However, be aware that this dilutes the information in the trace file, ...
    (comp.databases.oracle.server)
  • Re: dbs.Execute strSQL error - Too few parameters
    ... executing an update SQL statement in VBA. ... SQL executed with Execute goes straight to Jet without the advantage of the ... What is easier though is to delimit the statement so that the form reference ...
    (comp.databases.ms-access)
  • Re: dbs.Execute strSQL error - Too few parameters
    ... executing an update SQL statement in VBA. ... SQL executed with Execute goes straight to Jet without the advantage of the ... What is easier though is to delimit the statement so that the form reference ...
    (comp.databases.ms-access)