Hello all...
I have a field in a child table which belongs to a parent table. I'm going to add that field to the parent table and I'll remove it from the child table.
Now, data entry started a while back and there are a few hundred child records already. I want to copy the existing values of the field in question from the child table to the parent table.
Here's the layout:
ParentTable:
parentKeyField
...
fieldX (just added, has no data)
ChildTable:
childKeyField
parentKeyField
...
fieldX (to be removed; should have been in parentTable from the get go, but has data now)
-----------------------
I would like to do this with an Update Query which looks something along the lines of:
But the above obviously does not work because I'm missing something.
Can anyone shed some light?
Thanks
_________________________________
I think, therefore I am. [Rene Descartes]
I have a field in a child table which belongs to a parent table. I'm going to add that field to the parent table and I'll remove it from the child table.
Now, data entry started a while back and there are a few hundred child records already. I want to copy the existing values of the field in question from the child table to the parent table.
Here's the layout:
ParentTable:
parentKeyField
...
fieldX (just added, has no data)
ChildTable:
childKeyField
parentKeyField
...
fieldX (to be removed; should have been in parentTable from the get go, but has data now)
-----------------------
I would like to do this with an Update Query which looks something along the lines of:
Code:
UPDATE ParentTable
SET ParentTable.fieldX = ChildTable.fieldX
WHERE ParentTable.parentKeyField = ChildTable.parentKeyField
But the above obviously does not work because I'm missing something.
Can anyone shed some light?
Thanks
_________________________________
I think, therefore I am. [Rene Descartes]