如何在访问中添加表 [英] How to add a table in access

查看:79
本文介绍了如何在访问中添加表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



快速提问我目前有两张桌子可供使用,

table1是客户添加个人资料的地方< br $>
table2是客户在其债权人详细信息中添加的内容(包括他们的分期付款金额)



和表1中有一个名为总分期付款额的字段



我的问题是我如何运行一个查询,它将从表2中添加所有客户分期付款金额并在表1中插入总金额,注意2表通过他们的身份证号码链接,



希望这有意义

Hi guys

quick question i currently got 2 tables in access,
table1 is where the client add in his personal details
table2 is where the client add in his creditor details(including their installment amount)

and in table1 there is a field called total installment amount

my question is how do i run a query which will add all the clients installment amount from table 2 and insert the total amount in table 1, note that the 2 tables is linked via their ID Number,

hope this make sense

推荐答案

如果总分期金额是可以从其他领域派生,然后就不需要存储它。这就像从出生日期开始就达到某个人的年龄。您只需要存储出生日期,而年龄会随着时间的推移而增加,因此无法存储它。

了解更多:

1. http://www.datanamic.com/support/lt-dez005-introduction-db-modeling.html [ ^ ]

2. http://www.studytonight.com/dbms/database-normalization。 php [ ^ ]

要获得字段的总和,请查看以下内容: http://www.w3schools.com/sql /sql_func_sum.asp [ ^ ]
If the total installment amount is derivable from other fields, then there is no need to store it. It is like getting someone's age from his date of birth. You only need to store the date of birth whereas the age is incremented over time and thus no point in storing it.
Learn more:
1. http://www.datanamic.com/support/lt-dez005-introduction-db-modeling.html[^]
2. http://www.studytonight.com/dbms/database-normalization.php[^]
To get the sum of a field, check this out: http://www.w3schools.com/sql/sql_func_sum.asp[^]


虽然我有没试过这个,但它应该工作。如果没有,那么你可以进行谷歌搜索来调整它。



Though i have not tried this, but it should work. If it didn't then you can do a google search to tweak it.

update table1 as a
    set a.totalInstallmentAmount = (
        select SUM(b.credit) as credit
            from table2 b
            where b.ID= a.ID)


这篇关于如何在访问中添加表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆