Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

SQL Update one Table with records in Another Table

Jun 20, 2005 10:27AM PDT

I am trying to update all recors in one table with records from another table. My script is only updating one record. How do I fix this? This is what I have:

set rec1=con.execute ("SELECT * FROM Cancels ORDER BY Canceldate ASC")

rec2 = "update FC2003copy SET LPCancelDate = '" & rec1("canceldate") & "'" & _
"where CaseNum= '" & rec1("CaseNum") & "'"
Con.Execute(rec2)

Discussion is locked

- Collapse -
where's your loop
Jun 20, 2005 12:14PM PDT

i would think you'd need a loop in there somewhere to loop through all the records. As of now it's doing exactly what it should - update one record.

- Collapse -
Why not REPLACE?
Jun 20, 2005 9:30PM PDT