Home >Database >Mysql Tutorial >How Can I Update a Field in Microsoft Access 2007 Using a SELECT Query?
Update a Field Using a SELECT Query in Microsoft Access 2007
In Microsoft Access 2007, it is possible to update a field within a table by utilizing the results of a SELECT query. While Access may not allow aggregates in UPDATE queries, it can execute them in SELECT queries.
To achieve the desired update, follow these steps:
SELECT Min(TAX.Tax_Code) AS MinOfTax_Code FROM TAX, FUNCTIONS WHERE (((FUNCTIONS.Func_Pure)<=[Tax_ToPrice]) AND ((FUNCTIONS.Func_Year)=[Tax_Year])) GROUP BY FUNCTIONS.Func_ID;
SELECT YourQuery.* INTO MinOfTax_Code FROM YourQuery
This will create a table named "MinOfTax_Code" with the results of "YourQuery."
UPDATE MinOfTax_Code INNER JOIN Functions ON MinOfTax_Code.func_id = Functions.Func_ID SET Functions.Func_TaxRef = [MinOfTax_Code].[MinOfTax_Code]
By following these steps, you can effectively use a SELECT query to update a field of a table in Microsoft Access 2007.
The above is the detailed content of How Can I Update a Field in Microsoft Access 2007 Using a SELECT Query?. For more information, please follow other related articles on the PHP Chinese website!