Quote:
Originally posted by Jimbob
I need to update one table with the sum of values in another table, eg
set PaymentSummary.TotalCash to the sum of PaymentLine.Cash where both tables contain the same PayentRef column
I think I need to do this with a JOIN of some type, but I'm not sure which
anyone got any ideas....
I have found that it is often better to execute this type of transaction using code rather than SQL statements. I assume that you are trying to either roll-up monthly totals or create period reports in a summary table? In either case you gain a lot of control by writing a routine that opens a recordset containing the records that you want to tally and then using a do loop to tally them. Following this do loop you can either append the information to the second table or you can update the second table depending on your requirements. For instance: