PDA

View Full Version : Solved: Upadating from one table to another



AdrianK
06-19-2008, 07:29 AM
Hello,

I have 2 tables:

dbo_pmf (including columns qpc & short_name)
dbo_spt (including spt_sptlvl_val & spt_lvl_desc)

I am not sure if this is even possible, but I want to update the spt_lvl_desc column in dbo_spt, using the value from short_name in dbo_pmf, where qpc = spt_sptlvl_val.

I am using MS access.

I've tried various options, but can't seem to get it to work.

Is it possible, and can anyone help me??

Many thanks,

Adrian

stanl
06-21-2008, 07:50 AM
just guessing; but the dbo_ in your table names suggests they are linked. You cannot update linked tables unless you have specified a unique key for each used in your query. Stan

AdrianK
06-23-2008, 04:51 AM
Thanks, it's OK, i've solved the problem with the following:

UPDATE dbo_spt
INNER JOIN dbo_pmf ON dbo_spt.spt_sptlvl_val=dbo_pmf.qpc
SET spt_lvl_desc = dbo_pmf.short_name;

Adrian