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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need a Query to Correct some records 1

Status
Not open for further replies.

LeonelSanchezJr

Programmer
Jan 26, 2001
522
US
I have some records with incorrect data.
The HlpDsk_All.cCallnotes field contains the correct data. The CALLNOTES table only has two fields: ID and CALLNOTES. The HELPDESK table has a icallnoteskey field that points to the CALLNOTES table.

I need to write a query to update the records in my CALLNOTES table accordingly with what I have in my HlpDsk_All.cCallnotes field.


select hlpdsk_all.cproblemnum, hlpdsk_all.ccallnotes, callnotes.ccallnotes childrecord
from hlpdsk_all
left join helpdesk on hlpdsk_all.cproblemnum = helpdesk.cproblemnum
left join callnotes on helpdesk.icallnoteskey = callnotes.id
where hlpdsk_all.drecorded >= '05/23/01' and hlpdsk_all.drecorded < '05/24/01'
 
Try the following syntax:
update xxx
set a=t.x
from
{
select a, b x,... from yyy
} t
where xxx.l = t.a and.... John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top