0

我想用 WHERE 语句计算相关表中的字段。

为了计算相关表中的数据,我使用了这个语句。

=DCount("ID","Customers","AddressID=" & AddressID)

我必须为客户注册的每个地址计算客户,我将在其中检查每个地址有多少客户被禁止。

4

1 回答 1

1

您可以像这样构建 where 语句:

=DCount("ID","Customers","Banned = False And AddressID=" & AddressID)
=DCount("ID","Customers","Banned = 'No' And AddressID=" & AddressID)
=DCount("ID","Customers","Banned = ""No"" And AddressID=" & AddressID)
=DCount("ID","Customers","DateBanned = #2012/09/21# And AddressID=" & AddressID)

域聚合函数(如DCount )的第三个参数是 where 语句(条件),您可以在该参数中使用您将在查询中使用的大多数表达式。

于 2012-11-12T11:06:51.193 回答