N/APosted on - 07/15/2011
I created two fields for me to able to calculate the grades of the students. Why do I get this error in MS Access?
“Syntax error (missing operator) in query expression”
My query is Select [Quiz], [Homework] from Student Where [Average] = ([Quiz] + [Homework]);
Is there any other way to compute the average in another type of query? And do you experts have any suggestions on how to do it?
Syntax error(missing operator) in query expression
Simply, the way you are using is wrong and that is why you are facing this problem. You haven't mentioned in your question what method of query-making you are using. I am sending you here the solution to the syntax error and after that the complete method you can use next time.
Syntax is like: Average: [Quiz] + [Homework]
Here, you will use: colon instead of = sign, and semi colon is not allowed when you are working on databases like MS Access.
Follow the procedure for the complete solution:
Open Ms Access
Create Table with the required fields
Enter Records in the table via your software program.
Click on “Queries” tab from the left Objects Menu.
Double click on “Create Query in design View”.
Add the required Table from the given list.
Select required fields of the table. For Example, here you will select Quiz and Homework.
After selecting required fields right click on the immediate blank field after the field you have selected
A pop up menu will appear. From that menu, select “Build” option.
A build dialog box will appear
In that box, type (same as it is): Average: Quiz + Homework and press enter.
After that, for switching from the Design view to the Datasheet view, click on “View” from the menu bar and select “Datasheet View” from the submenu list.
The calculated record will appear in the form of a table. Check the average field for the correct calculation.
Perform this process step by step and Enjoy the Solution.