Question:

Update query in Access SQL?

by  |  earlier

0 LIKES UnLike

I have a table say A and a query B. A has date, type1_mins, type1_lines,type2_mins,type2_lines,........

Query B has date type2_lines,type2_mins.

I now want to update table A such that i copy values from query B and insert into in the corresponding record where the dates are equal.

Table A has empty records with date alone generated where there is no chance that a date in B is not present in table A

I used a join update query. i keep getting must use an updateable query as error.

Please Help me out.

(I dont know VBA and I dont know SQL in detail so make the solution simple)

 Tags:

   Report

1 ANSWERS


  1. Assuming that table "A" has "DateA" and "Data" fields while table "B" has "DateB" and "Data". Now use following Query:

    UPDATE A INNER JOIN B ON B.dateB = A.dateA

    SET A.data = [b].[data]

    WHERE A.[datea]=[dateb];

    Or create a query in design view, add both the tables, join both the dates then chose query type to "update query". Now select a.data in field and write [b].[data] in update to. in criteria write [a].[data]=[b].[data]. That's it. You may add other fields in successive columns (criteria once only will do).

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.