Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update one table with data from another table 1

Status
Not open for further replies.

soutener

IS-IT--Management
Jul 12, 2006
56
0
0
US
the nub returns...

i've tried several ways, and even google, but i'm yet to find an answer...

i have two tables, A and B

i want to update table A on column a.2 to equal b.2 where a.1=b.1

how i ask can i do this,
here is what i tried:
Code:
UPDATE NOFEAR.dbo.ConsignIVHSTH
SET NOFEAR.dbo.ConsignIVHSTH.DATE=NOFEAR.dbo.syper.DATE
WHERE NOFEAR.dbo.ConsignIVHSTH.IV_PERIOD=NOFEAR.dbo.syper.ACCPER;

here is the error:
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "NOFEAR.dbo.syper.ACCPER" could not be bound.


<incase anyone cares, here's why>
the way we do invoiceing is wierd, its based on accounting periods (for reporting/commissions/etc) so the invoice date doesnt matter, for this type of reporting, so i am trying to take the accounting period table's end date and change that with the invoice's date so i can then do other reports, the accounting period is a wierd format so it doesnt really work for automatically date ranging my reports

thanks for your help
 
Code:
UPDATEConsignIVHSTH
      SET ConsignIVHSTH.DATE = syper.DATE
FROM NOFEAR.dbo.ConsignIVHSTH ConsignIVHSTH
INNER JOIN NOFEAR.dbo.syper syper
           ON ConsignIVHSTH.IV_PERIOD=syper.ACCPER

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
ah, that makes perfect sense

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top