Microsoft Access表达式中的Dcount(Dcount in Microsoft Access expression)

编程入门 行业动态 更新时间:2024-10-24 22:17:43
Microsoft Access表达式中的Dcount(Dcount in Microsoft Access expression)

我一直在努力让dcount在现有数据库中工作,查询和报告名称相同并让我头疼,所以我创建了一个简单的1表db来测试它。

它有一个field1,其值为id1 id1 id2 id3

我想计算不同值的数量。 即从上面得到3。 我使用表达式在报表页脚中创建了一个包含字段的报表

=DCount("[Field1]","Table1")

..it返回4

然而,当我检查微软网站上有关dcount如何工作的描述时,它明显地说它计算了不同的条目。 有人可以澄清吗?

I've been trying to get dcount to work in an existing database with queries and report names that are the same and was giving myself a headache, so I created a simple 1 table db to test it out.

It has a field1 with these values id1 id1 id2 id3

I want to count the number of distinct values. i.e. get 3 from the above. I created a report with a field in the report footer with the expression

=DCount("[Field1]","Table1")

..it returns 4

Yet when I check the microsoft site for the description of how dcount works, it distinctly says it counts distinct entries. Can someone clarify?

最满意答案

我不知道你指的是哪个页面,但DCount只是计算记录,而不是明确的值。

为了计算不同的值,我建议Allen Browne的“扩展DCount”也称为ECount功能: http : ECount

此页面还提供了有关DCount如何工作的更多信息。

I don't know which page you are referring to, but DCount simply counts records, not distinct values.

To count distinct values, I suggest Allen Browne's "Extended DCount" aka ECount function: http://allenbrowne.com/ser-66.html

This page has also more information about how DCount works.

更多推荐

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

发布评论

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

>www.elefans.com

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