>Hi all,
>
>I have a template table :
>
>template.dbf
>empno balance
>
>11111
>22222
>33333
>44444
>
>with the data from temporarily table:
>
>temptable.dbf
>empno balance
>
>11111 10000
>44444 20000
>
>to update the above template.dbf table to have the results finally as:
>
>template.dbf
>empno balance
>
>11111 10000
>22222 0
>33333 0
>44444 20000
>
>TIA.
Hi Paul,
Assuming VFP9 you may use this syntax:
update Template set Balance = temp.Balance from Template ;
inner join TempTable Temp on Template.EmpNo = Temp.EmpNo
If you didn't have 0 in non-matched records and you want to reset them now to 0, use this:
update Template set Balance = nvl(temp.Balance,0) from Template ;
LEFT join TempTable Temp on Template.EmpNo = Temp.EmpNo
If it's not broken, fix it until it is.
My Blog