• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 408
  • Last Modified:

Copy a calculated query value to a field in table

Hello, I have a query where I calculate a few values using IIf statements.  I want to take the results of this calculation and copy them to a field in the underlying table (this field is also in the query).  How would I go about doing this (Calcfield: IIf(statement) to DestinationField both in the same query).

Thanks,
Bevo
0
Bevos
Asked:
Bevos
4 Solutions
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
Bevo,

 Change the query to an "update" query by right clicking in the blank area at the top (where the tables are), and going down to query type.  Then select update.

 In the query grid, you'll see a new line appear "Update to".

  Copy and paste the IIF() you need to this line under the field name that you want to update.

JimD.
0
 
peter57rCommented:
You can't store anything using a Select query.

You have to create an update query if you want to store values in existing records, or an append query if you are creating new records.

So you need to provide more details.
0
 
BevosAuthor Commented:
Hi Peter and JDettman, thanks for the informative responses.  I think I understand what you are saying with the update query, but I have a question. Should I wait until all the data is entered for this project to run the update query and copy over the IIf statements to the table fields?

Thanks,
Bevo
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:

  At a guess, yes.  But that's just a guess as we have no idea what it is your doing.


JimD.
0
 
Jeffrey CoachmanCommented:
...yes your requirement of copying the results of a query back to the source table is a bit confusing.

Can you first take a step back and explain your ultimate goal here, and the structure of this data?
0
 
BevosAuthor Commented:
Hi, sorry to be vague.  Basically this will be copied into a table that is ultimately exported as a CSV for import into a reference manager called End Note.  I only really need this as an end product so it isn't too much of a worry just to do this once at the end I believe.

I think I have everything I need now so I'm going to close the question.

Thanks for all of the great comments,
Bevo
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now