Consulting

Results 1 to 3 of 3

Thread: Solved: Upadating from one table to another

  1. #1
    VBAX Regular
    Joined
    Jan 2008
    Posts
    34
    Location

    Solved: Upadating from one table to another

    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

  2. #2
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    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

  3. #3
    VBAX Regular
    Joined
    Jan 2008
    Posts
    34
    Location
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •