What is the best/easiest way to convert a Select SQL statement containing a CTE and join to another file into an UPDATE? The following gives me the accounts I want to target, so now I want to update a field to a different value.
The records selected by this SQL will have their ZB$ASC field updated from 'C' to 'L', so I'm just looking for advice on the best way to convert these kinds of SQL statements from select to update.
Thanks!
Code:
with writeoffs as (select zd$gnr as WOAcct, (zd$ndy * 10000 + zd$ndm * 100 + zd$ndd) as WODate from F58211 where zd$ttp = 'WO') Select ZB$GNR as Acct, ZB$STR as AcctStore, WODate From F58201 accts join writeoffs on accts.ZB$GNR = WOAcct Where accts.zb$ASC = 'C'
Thanks!
Comment