查询/子查询 - 百分比 [英] Query/Subquery - Percentage

查看:68
本文介绍了查询/子查询 - 百分比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。


i有3个字段:


1.代码(Mon01,Mon02等)

2.回收(复选框,是或否)

3.吨位


此表中有超过10,000条记录。我试图在查询中计算每个代码的百分比(总计约70),从回收记录的总吨位(勾选复选框)


我尝试过使用吨位字段中的子查询选择回收=是的记录。我收到一条错误消息,说子查询将返回1,如果有任何结果。


任何帮助请!!!!

Hello everyone

i have 3 fields:

1. Code (Mon01, Mon02 etc)
2. Recycling (Check box, yes or no)
3. Tonnage

There are over 10,000 records in this table. I am trying to calculate in a query the percent for each code (Total approx 70), from the sum tonnage for records that are recycling (Check box ticked)

I have tried using a subquery in the tonnage field selecting records where recycling = yes. i get an error message saying the subquery will return 1 if any results.

Any help please!!!!

推荐答案

首先设计一个由[code]和WHERE [Recycling]组成的查询。


接下来构建一个查询,其中每个记录的计数除以DCount()表格中的所有[回收]记录。


这有意义吗?
Start by designing a query which is GROUPed by [code] and WHERE [Recycling].

Next build a query from that where each record has the count divided by a DCount() of all the [Recycling] records in the table.

Does that make sense?


大概是。


你将如何编写第二部分的Dcount / Count表达式?
erm roughly.

How would you go about writing the Dcount/Count expression for the second part??


展开 | 选择 | 换行 | 行号


这篇关于查询/子查询 - 百分比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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