Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2006
    Posts
    59

    Arrow Unanswered: Whats Wrong With This Query

    hello

    i am trying to run this query

    UPDATE closedtransactions c set
    c.pl = (select p.tot from buy_open_trades p where c.ticketno=p.ticketno);
    i am getting this error.. 'Operation must use an Updateable Query '

    i guess my query is update query .. can anyone explain whats wrong in it
    thanks

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    haven't got a clue.....

    but why are you wnating to stroe derived data in your db?
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    I'm trying to figure out why you're doing your update query that way ...

    UPDATE closedtransactions INNER JOIN buy_open_trades ON closedtransactions.ticketno=buy_open_trades.ticket no SET closedtransactions.pl=buy_open_trades.tot;

    You can alias if you want ...
    Back to Access ... ADO is not the way to go for speed ...

  4. #4
    Join Date
    Jun 2006
    Posts
    103
    Quote Originally Posted by stocks159
    hello

    i am trying to run this query

    UPDATE closedtransactions c set
    c.pl = (select p.tot from buy_open_trades p where c.ticketno=p.ticketno);

    i am getting this error.. 'Operation must use an Updateable Query '

    i guess my query is update query .. can anyone explain whats wrong in it
    thanks

    I am not sure what u try to do there, but your query does has an error

    select p.tot from buy_open_trades p where c.ticketno=p.ticketno will give u a list of p.tot, maybe 1, maybe 100+, now u r trying to update c.pl to 100+ values if the select statement behind query out 100+ records? definately, the database will not allow this to happen...

    If u run your select query behind in a seperate query. see what records u will get before u proceed with this update statement.


    Maybe u try to tell us what're u going to do? like what u want c.pl value to be? in what condition (your where statement)
    Last edited by mkggoh; 06-15-06 at 22:21.

Posting Permissions

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