从查询查询更新查询

编程入门 行业动态 更新时间:2024-10-28 08:25:40
本文介绍了从查询查询更新查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个电子表格,正在将其转换为Access DB.我有一列输入的客户名称,我想用我们会计系统中的相应客户编号替换.

I have a spreadsheet that I am converting to an Access DB. I have a column of typed out customer names that I want to replace with the appropriate customer number from our accounting system.

我创建了一个包含客户信息的表,以及一个查询,该查询显示了需要在源数据中插入哪些ID.我正在寻找的是:

I have created a table with the customer info, and a query that shows what ID needs to be inserted into the source data. What I'm looking for is:

UPDATE tblStarting_Data SET CustomerID=x WHERE TEMPCustomer=y

X和Y来自qryIDPerCustomer.

Where X and Y come from qryIDPerCustomer.

我可以使用循环吗?如何引用另一个查询?

Can I use a loop? How do I reference another query?

推荐答案

MS Access中的另一种可能性(从Tomalak答案中借用的对象名称):

Another possibility in MS Access (object names borrowed from Tomalak answer):

UPDATE tblStarting_Data, qryIDPerCustomer SET tblStarting_Data.CustomerID=qryIDPerCustomer.CustomerID WHERE tblStarting_Data.TEMPCustomer=qryIDPerCustomer.CustomerName

更多推荐

从查询查询更新查询

本文发布于:2023-10-27 02:39:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1532059.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!