Gossamer Forum
Home : General : Databases and SQL :

Query Question

Quote Reply
Query Question
I'm a student and just learning SQL. i'm doing a project that has multiple tables, forms, queries, reports, etc. Anyway I have to use 10 queries that will fill in a table with the correct information from other tables. I got most of the queries to work expect one. Can someone please look at my code and tell me what i'm doing wrong..I've been trying to figure this out since Friday.

The error I keep getting asks me to enter parameter values.

Table filling in is called FinalGrades, Table info is coming from are Grade and Gradeweight. Attributues coming from tables are StudentID, homework2.

UPDATE FinalGrades, Gradeweight SET FinalGrades.Homework2 = grade.Homework2*gradeweight.weight
WHERE finalgrades.studentid=grade.studentid AND gradeweight.item="homework2";


Thanks for your help!
Quote Reply
Re: [lookn4troubl] Query Question In reply to
You can not update two tables within the same query as you've written it. You will need to loop through two update query statements or use sub-queries to update data in both tables.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Query Question In reply to
It's nice to see that this has become possible in MySQL 4:

http://www.mysql.com/doc/en/UPDATE.html

There are a lot of places where a multi table update would be so handy. =)

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Query Question In reply to
Yep...but I think the user is using Access as the database application for his or her project.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Query Question In reply to
I think Alex was just adding a sort of "FYI" to the thread regarding MySQL.
Quote Reply
Re: [Paul] Query Question In reply to
That's cool, and I am aware of that, however, the point of the thread, was to provide support to a user who is _not using MySQL, but Access. Thus, the MySQL supportive function is great and useful to know, but not in the context of this thread, IMO.
========================================
Buh Bye!

Cheers,
Me