Update query

Results 1 to 2 of 2

Thread: Update query

  1. #1
    Join Date
    Dec 1969

    Default Update query

    I have the following query in SQL 2000<BR><BR>UPDATE pnLog_041102<BR>SET PRJT = pnlistnew.prjt<BR>WHERE (ePN = 26322)<BR><BR>I getting this error:<BR>"The column prefix &#039;pnlistnew&#039; does not match with a table used in the<BR>query"<BR><BR>I want to replace the prjt field with the one in the pnlistnew table where<BR>the epn is 26322. I am sure that &#039;pnlistnew&#039; is a table in my database. What<BR>am I doing wrong?<BR><BR>Thanks in Advance,<BR>Lane<BR>

  2. #2
    Join Date
    Dec 1969

    Default You can't do that...

    What it&#039;s telling you is you can&#039;t update a field in one table with a field from another table...<BR><BR>You&#039;ll have to do something like this...<BR><BR>Get your value that you want to update table with...<BR><BR>UPDATE pnLog_041102<BR>SET PRJT = YourValueToUpdate<BR>WHERE (pnLog_041102.ePN = 26322)<BR><BR>KLC<BR>

Posting Permissions

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