Writing the result of a Query to a Table

daievans

Registered User.
Local time
Today, 03:35
Joined
Apr 3, 2013
Messages
75
I use a query to sum the outstanding balances that are included in a particular file to a summary table (I call it my Vault) The original file may include dozens of accounts, but all I want to write to the Vault is the sum of the balances.

The query is named "Sum of Account Balances" - the field being summed is "Balances" - How do I write this total to another table - I'm having a complete brain fade on the process. :confused:

Thanks!
 
Assuming you have a valid reason for storing a calculated value like this in a table, then;

Write as a new record?

Insert Into YourTable(YourField)
Select Balances
From YourQuery

Update an existing row?

Update YourTable
InnerJoin YourQuery On YourTable.SomeField = YourQuery.SomeField
Set YourTable.YourField = YourQuery.Balances
 
Assuming you have a valid reason for storing a calculated value like this in a table, then;

Write as a new record?

Insert Into YourTable(YourField)
Select Balances
From YourQuery

Update an existing row?

Update YourTable
InnerJoin YourQuery On YourTable.SomeField = YourQuery.SomeField
Set YourTable.YourField = YourQuery.Balances

Hearing you on your Storing calculated values - I'm opposed to the idea as I think we can always get at it through a query, but others are not as convinced, and they want to have their own way ;)

And thanks for including both scenarios - I'm trying to write to an existing record in this case! I'll give it a go in the morning - am off out with Missus for a bite now ... :D
 

Users who are viewing this thread

Back
Top Bottom