Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Update a column

Update a column

Scheduled Pinned Locked Moved Database
databasehelptutorialquestionannouncement
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hum Dum
    wrote on last edited by
    #1

    I want to update a column of one table A with column of another table B. for one entry of A, B contains 2 or more entry. Say A is super table of B. I wrote a query like this

    UPDATE SendSet SET oDate = (Select oOrder.oDate from oOrder where oOrder.oID=SendSet.oID)
    WHERE Exists (Select oOrder.oDate from oOrder where oOrder.oID=SendSet.oID);

    DB is MS-Access. But it gives error : Operation must use an updatable query !! You attempted to run a query that tried to update a field that cannot be updated. For example, you may have created the query in such a way that you tried to update a field on the one side of a one-to-many relationship. any help ?

    L 2 Replies Last reply
    0
    • H Hum Dum

      I want to update a column of one table A with column of another table B. for one entry of A, B contains 2 or more entry. Say A is super table of B. I wrote a query like this

      UPDATE SendSet SET oDate = (Select oOrder.oDate from oOrder where oOrder.oID=SendSet.oID)
      WHERE Exists (Select oOrder.oDate from oOrder where oOrder.oID=SendSet.oID);

      DB is MS-Access. But it gives error : Operation must use an updatable query !! You attempted to run a query that tried to update a field that cannot be updated. For example, you may have created the query in such a way that you tried to update a field on the one side of a one-to-many relationship. any help ?

      L Offline
      L Offline
      loyal ginger
      wrote on last edited by
      #2

      You can use a join in your update query. Please check out how to do a join.

      1 Reply Last reply
      0
      • H Hum Dum

        I want to update a column of one table A with column of another table B. for one entry of A, B contains 2 or more entry. Say A is super table of B. I wrote a query like this

        UPDATE SendSet SET oDate = (Select oOrder.oDate from oOrder where oOrder.oID=SendSet.oID)
        WHERE Exists (Select oOrder.oDate from oOrder where oOrder.oID=SendSet.oID);

        DB is MS-Access. But it gives error : Operation must use an updatable query !! You attempted to run a query that tried to update a field that cannot be updated. For example, you may have created the query in such a way that you tried to update a field on the one side of a one-to-many relationship. any help ?

        L Offline
        L Offline
        loyal ginger
        wrote on last edited by
        #3

        Without knowing the relationship between table A and table B, I can only suggest that you use something like this:

        update SendSet inner join oOrder on SendSet.oID=oOrder.oID set SendSet.oDate=oOrder.oDate;

        You need to work out what exactly you need to do this update. Happy programming!

        H 1 Reply Last reply
        0
        • L loyal ginger

          Without knowing the relationship between table A and table B, I can only suggest that you use something like this:

          update SendSet inner join oOrder on SendSet.oID=oOrder.oID set SendSet.oDate=oOrder.oDate;

          You need to work out what exactly you need to do this update. Happy programming!

          H Offline
          H Offline
          Hum Dum
          wrote on last edited by
          #4

          Thanks. it works. regards :)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups